Send object a message instead of directly setting the attribute #1
@ -71,7 +71,7 @@ module SeedFuMongoid
|
||||
|
||||
def seed!
|
||||
data.each do |key, value|
|
||||
document[key] = value
|
||||
document.send :"#{key}=", value
|
||||
end
|
||||
|
||||
puts "#{@klass.name} #{document.attributes}"
|
||||
|
Loading…
Reference in New Issue
Block a user