diff --git a/app/controllers/admin/enterprises_controller.rb b/app/controllers/admin/enterprises_controller.rb index 96e77f129d..c216b1badf 100644 --- a/app/controllers/admin/enterprises_controller.rb +++ b/app/controllers/admin/enterprises_controller.rb @@ -42,7 +42,7 @@ module Admin end def bulk_update - @enterprise_set = EnterpriseSet.new(params[:enterprise_set].merge collection: collection) + @enterprise_set = EnterpriseSet.new(collection, params[:enterprise_set]) if @enterprise_set.save flash[:success] = 'Enterprises updated successfully' redirect_to main_app.admin_enterprises_path @@ -67,7 +67,7 @@ module Admin private def load_enterprise_set - @enterprise_set = EnterpriseSet.new :collection => collection + @enterprise_set = EnterpriseSet.new collection end def load_countries diff --git a/app/models/enterprise_set.rb b/app/models/enterprise_set.rb index 81591b6dad..0eef0ea3c8 100644 --- a/app/models/enterprise_set.rb +++ b/app/models/enterprise_set.rb @@ -1,5 +1,5 @@ class EnterpriseSet < ModelSet - def initialize(attributes={}) - super(Enterprise, Enterprise.all, nil, attributes) + def initialize(collection, attributes={}) + super(Enterprise, collection, nil, attributes) end end