diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-16 11:46:34 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-16 13:52:07 +0000 |
commit | 0b08ff7d92124cc370e9f0795d1559204f04f9a4 (patch) | |
tree | 3f7e8a98b782952e12d872f20cb7603d1b014d13 /activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | |
parent | 4fe76f4f272571bb88aa54af1d7e6bcad413c6e1 (diff) | |
download | rails-0b08ff7d92124cc370e9f0795d1559204f04f9a4.tar.gz rails-0b08ff7d92124cc370e9f0795d1559204f04f9a4.tar.bz2 rails-0b08ff7d92124cc370e9f0795d1559204f04f9a4.zip |
Cache columns at the model level.
Allows two models to use the same table but have different primary keys.
Diffstat (limited to 'activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index 745f7132e7..bc6ebb076e 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -826,11 +826,11 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase david.projects.reset_column_information # One query for columns, one for primary key, one for table existence - assert_queries(3) { david.projects.columns; david.projects.columns } + assert_queries(1) { david.projects.columns; david.projects.columns } ## and again to verify that reset_column_information clears the cache correctly david.projects.reset_column_information - assert_queries(3) { david.projects.columns; david.projects.columns } + assert_queries(1) { david.projects.columns; david.projects.columns } end def test_attributes_are_being_set_when_initialized_from_habm_association_with_where_clause |