allow override of default limit (<200) on articles on shared suppliers (#609)

This commit is contained in:
Tom Carchrae 2019-01-14 17:55:12 -08:00 committed by Patrick Gansterer
parent a66a44bdcf
commit 31689dfb75
3 changed files with 4 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class SharedSupplier < ActiveRecord::Base
# return list of synchronisation methods available for this supplier
def shared_sync_methods
methods = []
methods += %w(all_available all_unavailable) if shared_articles.count < 200
methods += %w(all_available all_unavailable) if shared_articles.count < FoodsoftConfig[:shared_supplier_article_sync_limit]
methods += %w(import) # perhaps, in the future: if shared_articles.count > 20
methods
end

View File

@ -162,6 +162,8 @@ default: &defaults
# Instead of defining all details here, you can also point to an entry in database.yml.
#shared_lists: shared_lists
# default to allow sync only on less than 200 articles
#shared_supplier_article_sync_limit: 200,
development:
<<: *defaults

View File

@ -256,6 +256,7 @@ class FoodsoftConfig
contact: {}, # avoid errors when undefined
tasks_period_days: 7,
tasks_upfront_days: 49,
shared_supplier_article_sync_limit: 200,
# The following keys cannot, by default, be set by foodcoops themselves.
protected: {
multi_coop_install: true,