diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2010-05-18 22:49:19 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-07 10:45:47 +0200 |
commit | 7eedc3f3975cca2b7e729fcb67e310977b5e5dcd (patch) | |
tree | 1930f68b340ab0182557786246c5c86f6d39e3ba | |
parent | 3f1cdb85b80b935791018e59161e527617af6f1f (diff) | |
download | rails-7eedc3f3975cca2b7e729fcb67e310977b5e5dcd.tar.gz rails-7eedc3f3975cca2b7e729fcb67e310977b5e5dcd.tar.bz2 rails-7eedc3f3975cca2b7e729fcb67e310977b5e5dcd.zip |
Fixing test class names and refactor line in autosave association
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | activerecord/lib/active_record/autosave_association.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/autosave_association_test.rb | 8 | ||||
-rw-r--r-- | activerecord/test/cases/nested_attributes_test.rb | 4 |
3 files changed, 7 insertions, 7 deletions
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 diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb index 063f0f0fb2..4e4f9c385c 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -1149,7 +1149,7 @@ class TestAutosaveAssociationOnAHasAndBelongsToManyAssociation < ActiveRecord::T include AutosaveAssociationOnACollectionAssociationTests end -class TestAutosaveAssociationValidationsOnAHasManyAssocication < ActiveRecord::TestCase +class TestAutosaveAssociationValidationsOnAHasManyAssociation < ActiveRecord::TestCase self.use_transactional_fixtures = false def setup @@ -1165,7 +1165,7 @@ class TestAutosaveAssociationValidationsOnAHasManyAssocication < ActiveRecord::T end end -class TestAutosaveAssociationValidationsOnAHasOneAssocication < ActiveRecord::TestCase +class TestAutosaveAssociationValidationsOnAHasOneAssociation < ActiveRecord::TestCase self.use_transactional_fixtures = false def setup @@ -1186,7 +1186,7 @@ class TestAutosaveAssociationValidationsOnAHasOneAssocication < ActiveRecord::Te end end -class TestAutosaveAssociationValidationsOnABelongsToAssocication < ActiveRecord::TestCase +class TestAutosaveAssociationValidationsOnABelongsToAssociation < ActiveRecord::TestCase self.use_transactional_fixtures = false def setup @@ -1206,7 +1206,7 @@ class TestAutosaveAssociationValidationsOnABelongsToAssocication < ActiveRecord: end end -class TestAutosaveAssociationValidationsOnAHABTMAssocication < ActiveRecord::TestCase +class TestAutosaveAssociationValidationsOnAHABTMAssociation < ActiveRecord::TestCase self.use_transactional_fixtures = false def setup diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb index 57b66fb312..685b11cb03 100644 --- a/activerecord/test/cases/nested_attributes_test.rb +++ b/activerecord/test/cases/nested_attributes_test.rb @@ -734,7 +734,7 @@ class TestNestedAttributesWithNonStandardPrimaryKeys < ActiveRecord::TestCase end end -class TestHasOneAutosaveAssoictaionWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase +class TestHasOneAutosaveAssociationWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase self.use_transactional_fixtures = false def setup @@ -774,7 +774,7 @@ class TestHasOneAutosaveAssoictaionWhichItselfHasAutosaveAssociations < ActiveRe end end -class TestHasManyAutosaveAssoictaionWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase +class TestHasManyAutosaveAssociationWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase self.use_transactional_fixtures = false def setup |