aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/reflection_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-12-22 20:57:41 +0000
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-23 15:19:18 -0800
commit2d9626fc74c2d57f90c856c37e5967bbe6651bd8 (patch)
tree067d9d8015680e1df6308aeff4fe9bf3e8fb33e0 /activerecord/test/cases/reflection_test.rb
parent3f17ed407c5d61bc01fd59776205486c2350f36e (diff)
downloadrails-2d9626fc74c2d57f90c856c37e5967bbe6651bd8.tar.gz
rails-2d9626fc74c2d57f90c856c37e5967bbe6651bd8.tar.bz2
rails-2d9626fc74c2d57f90c856c37e5967bbe6651bd8.zip
Improved strategy for updating a belongs_to association when the foreign key changes. Rather than resetting each affected association when the foreign key changes, we should lazily check for 'staleness' (where fk does not match target id) when the association is accessed.
Diffstat (limited to 'activerecord/test/cases/reflection_test.rb')
-rw-r--r--activerecord/test/cases/reflection_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/reflection_test.rb b/activerecord/test/cases/reflection_test.rb
index 1e205714a7..901c12b26c 100644
--- a/activerecord/test/cases/reflection_test.rb
+++ b/activerecord/test/cases/reflection_test.rb
@@ -7,6 +7,7 @@ require 'models/subscriber'
require 'models/ship'
require 'models/pirate'
require 'models/price_estimate'
+require 'models/tagging'
class ReflectionTest < ActiveRecord::TestCase
include ActiveRecord::Reflection
@@ -194,6 +195,7 @@ class ReflectionTest < ActiveRecord::TestCase
def test_association_primary_key
assert_equal "id", Author.reflect_on_association(:posts).association_primary_key.to_s
assert_equal "name", Author.reflect_on_association(:essay).association_primary_key.to_s
+ assert_equal "id", Tagging.reflect_on_association(:taggable).association_primary_key.to_s
end
def test_active_record_primary_key