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 # return list of synchronisation methods available for this supplier
def shared_sync_methods def shared_sync_methods
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 += %w(import) # perhaps, in the future: if shared_articles.count > 20
methods methods
end 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. # Instead of defining all details here, you can also point to an entry in database.yml.
#shared_lists: shared_lists #shared_lists: shared_lists
# default to allow sync only on less than 200 articles
#shared_supplier_article_sync_limit: 200,
development: development:
<<: *defaults <<: *defaults

View file

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