From 46148145f695a5e3c569533cf4e325157b91c142 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 6 Feb 2014 23:39:26 +0000 Subject: [PATCH] rails3: use assign_attributes on factory build --- test/factories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/factories.rb b/test/factories.rb index c035d31..9e98a02 100644 --- a/test/factories.rb +++ b/test/factories.rb @@ -42,7 +42,7 @@ module Noosfero::Factory attrs[:slug] = attrs[:name].to_slug if attrs[:name].present? && attrs[:slug].blank? && defaults[:slug].present? data = defaults_for(name).merge(attrs) object = name.to_s.camelize.constantize.new - data.each { |attribute, value| object.send(attribute.to_s+'=', value) } + object.assign_attributes(data, :without_protection => true) object end -- libgit2 0.21.2