Permalink
Browse files

Make seed_fu work with models that have protected attributes

  • Loading branch information...
1 parent bfee2d0 commit 42ca7aba4e02c58c9fa163e25a055f92bbd35f2d @hmans hmans committed Apr 21, 2008
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/seeder.rb
View
@@ -28,7 +28,9 @@ def set_attribute(name, value)
def plant!
record = get
- record.attributes = @data
+ @data.each do |k, v|
+ record.send("#{k}=", v)
+ end
record.save!
puts " - #{@model_class} #{condition_hash.inspect}"
record

0 comments on commit 42ca7ab

Please sign in to comment.