From 7eedc3f3975cca2b7e729fcb67e310977b5e5dcd Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 18 May 2010 22:49:19 -0300 Subject: Fixing test class names and refactor line in autosave association MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/lib/active_record/autosave_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index c553e95bad..59a7bc1da1 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -243,7 +243,7 @@ module ActiveRecord if [:belongs_to, :has_one].include?(reflection.macro) return true if association.target && association.target.changed_for_autosave? else - association.target.each {|record| return true if record.changed_for_autosave? } + return true if association.target.detect { |record| record.changed_for_autosave? } end end end -- cgit v1.2.3