From 09b470a81df485c50a1ea62c9c0a26ea02d07003 Mon Sep 17 00:00:00 2001 From: Patrick Blesi Date: Mon, 17 Mar 2014 21:04:08 -0500 Subject: [PATCH] Use mongoid write_attribute method instead of attribute= method in order to support mongoid dynamic field assignment --- lib/seed-fu-mongoid/document_seeder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/seed-fu-mongoid/document_seeder.rb b/lib/seed-fu-mongoid/document_seeder.rb index 58dfec3..941cd8c 100644 --- a/lib/seed-fu-mongoid/document_seeder.rb +++ b/lib/seed-fu-mongoid/document_seeder.rb @@ -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}"