Use mongoid write_attribute method instead of attribute= method in order to support mongoid dynamic field assignment
This commit is contained in:
parent
a6b1bbaf77
commit
09b470a81d
|
@ -71,7 +71,7 @@ module SeedFuMongoid
|
|||
|
||||
def seed!
|
||||
data.each do |key, value|
|
||||
document.send :"#{key}=", value
|
||||
document.send :[]=, key, value
|
||||
end
|
||||
|
||||
puts "#{@klass.name} #{document.attributes}"
|
||||
|
|
Loading…
Reference in New Issue