aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-15 14:45:00 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-15 14:45:00 -0700
commitee46f1d5d2a8825de2d4973fb0301f2d85986e73 (patch)
tree23bc39bf0a63c4436ce3aadedfab9dd7cde5b909 /activerecord/test/cases/associations
parent704bf0ecc550552f1cc5e453771917e8782b64ad (diff)
parente3e3851ed662fc55ee88c16a3cd9bb87f24e6bd6 (diff)
downloadrails-ee46f1d5d2a8825de2d4973fb0301f2d85986e73.tar.gz
rails-ee46f1d5d2a8825de2d4973fb0301f2d85986e73.tar.bz2
rails-ee46f1d5d2a8825de2d4973fb0301f2d85986e73.zip
Merge branch 'master' into joindep
* master: (44 commits) grammar fix (reverted in e9a1ecd) Revert "fixed a doc bug in the CHANGELOG.md s/does no longer depend on/no longer depends on/" Add missed require making `enable_warnings` available Prepare generated Gemfile for Capistrano 3 Added --model-name option scaffold_controller_generator. read the association instead of sending we should have unique sponsorable ids in the fixtures at least simplify populating the ordering hash the preloader for the RHS has all the preloaded records, so ask it only calculate offset index once. #12537 Remove size alias for length validation Fix `singleton_class?` Minor Refactoring to `NumberHelper#number_to_human` `$SAFE = 4;` has been removed with Ruby 2.1 scope_chain should not be mutated for other reflections Remove `default_primary_key_type` and extract contains of `native_database_types` to a constant since they aren't conditional now in SQLite3Adapter. Makes it more like other adapters. cleanup changelog entry format. [ci skip] Extract a function to determine if the default value is a function Push default_function to superclass to avoid method check Dump the default function when the primary key is uuid ... Conflicts: activerecord/lib/active_record/relation/finder_methods.rb
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/inverse_associations_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/inverse_associations_test.rb b/activerecord/test/cases/associations/inverse_associations_test.rb
index 8c81e00865..893030345f 100644
--- a/activerecord/test/cases/associations/inverse_associations_test.rb
+++ b/activerecord/test/cases/associations/inverse_associations_test.rb
@@ -603,6 +603,18 @@ class InversePolymorphicBelongsToTests < ActiveRecord::TestCase
assert_equal face.description, new_man.polymorphic_face.description, "Description of face should be the same after changes to replaced-parent-owned instance"
end
+ def test_inversed_instance_should_not_be_reloaded_after_stale_state_changed
+ new_man = Man.new
+ face = Face.new
+ new_man.face = face
+
+ old_inversed_man = face.man
+ new_man.save!
+ new_inversed_man = face.man
+
+ assert_equal old_inversed_man.object_id, new_inversed_man.object_id
+ end
+
def test_should_not_try_to_set_inverse_instances_when_the_inverse_is_a_has_many
i = interests(:llama_wrangling)
m = i.polymorphic_man