diff --git a/app/models/model_set.rb b/app/models/model_set.rb index d4760884b5..24e84008a0 100644 --- a/app/models/model_set.rb +++ b/app/models/model_set.rb @@ -8,6 +8,9 @@ class ModelSet def initialize(klass, collection, reject_if=nil, attributes={}) @klass, @collection, @reject_if = klass, collection, reject_if + # Set here first, to ensure that we apply collection_attributes to the right collection + @collection = attributes[:collection] if attributes[:collection] + attributes.each do |name, value| send("#{name}=", value) end