Skip to content
This repository
Browse code

Fixing test class names and refactor line in autosave association

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 7eedc3f3975cca2b7e729fcb67e310977b5e5dcd 1 parent 3f1cdb8
Carlos Antonio da Silva carlosantoniodasilva authored josevalim committed
2  activerecord/lib/active_record/autosave_association.rb
@@ -243,7 +243,7 @@ def nested_records_changed_for_autosave?
243 243 if [:belongs_to, :has_one].include?(reflection.macro)
244 244 return true if association.target && association.target.changed_for_autosave?
245 245 else
246   - association.target.each {|record| return true if record.changed_for_autosave? }
  246 + return true if association.target.detect { |record| record.changed_for_autosave? }
247 247 end
248 248 end
249 249 end
8 activerecord/test/cases/autosave_association_test.rb
@@ -1149,7 +1149,7 @@ def setup
1149 1149 include AutosaveAssociationOnACollectionAssociationTests
1150 1150 end
1151 1151
1152   -class TestAutosaveAssociationValidationsOnAHasManyAssocication < ActiveRecord::TestCase
  1152 +class TestAutosaveAssociationValidationsOnAHasManyAssociation < ActiveRecord::TestCase
1153 1153 self.use_transactional_fixtures = false
1154 1154
1155 1155 def setup
@@ -1165,7 +1165,7 @@ def setup
1165 1165 end
1166 1166 end
1167 1167
1168   -class TestAutosaveAssociationValidationsOnAHasOneAssocication < ActiveRecord::TestCase
  1168 +class TestAutosaveAssociationValidationsOnAHasOneAssociation < ActiveRecord::TestCase
1169 1169 self.use_transactional_fixtures = false
1170 1170
1171 1171 def setup
@@ -1186,7 +1186,7 @@ def setup
1186 1186 end
1187 1187 end
1188 1188
1189   -class TestAutosaveAssociationValidationsOnABelongsToAssocication < ActiveRecord::TestCase
  1189 +class TestAutosaveAssociationValidationsOnABelongsToAssociation < ActiveRecord::TestCase
1190 1190 self.use_transactional_fixtures = false
1191 1191
1192 1192 def setup
@@ -1206,7 +1206,7 @@ def setup
1206 1206 end
1207 1207 end
1208 1208
1209   -class TestAutosaveAssociationValidationsOnAHABTMAssocication < ActiveRecord::TestCase
  1209 +class TestAutosaveAssociationValidationsOnAHABTMAssociation < ActiveRecord::TestCase
1210 1210 self.use_transactional_fixtures = false
1211 1211
1212 1212 def setup
4 activerecord/test/cases/nested_attributes_test.rb
@@ -734,7 +734,7 @@ def test_should_update_existing_records_with_non_standard_primary_key
734 734 end
735 735 end
736 736
737   -class TestHasOneAutosaveAssoictaionWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase
  737 +class TestHasOneAutosaveAssociationWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase
738 738 self.use_transactional_fixtures = false
739 739
740 740 def setup
@@ -774,7 +774,7 @@ def setup
774 774 end
775 775 end
776 776
777   -class TestHasManyAutosaveAssoictaionWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase
  777 +class TestHasManyAutosaveAssociationWhichItselfHasAutosaveAssociations < ActiveRecord::TestCase
778 778 self.use_transactional_fixtures = false
779 779
780 780 def setup

0 comments on commit 7eedc3f

Please sign in to comment.
Something went wrong with that request. Please try again.