mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Ensure collection is locked down before we start asssigning attributes to model set
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user