From 90246ef2efb7046256921183cab103d990358c82 Mon Sep 17 00:00:00 2001 From: ryu39 Date: Sun, 16 Oct 2016 17:17:27 +0900 Subject: [PATCH] Fix ArgumentError in Rails 3.2 --- lib/seed-fu/seeder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/seed-fu/seeder.rb b/lib/seed-fu/seeder.rb index 37a3ea8..809da30 100644 --- a/lib/seed-fu/seeder.rb +++ b/lib/seed-fu/seeder.rb @@ -76,7 +76,7 @@ def seed_record(data) end def find_or_initialize_record(data) - @model_class.where(constraint_conditions(data)).take || + @model_class.where(constraint_conditions(data)).limit(1).to_a.first || @model_class.new end