Changeset 3043
- Timestamp:
- 11/15/05 10:48:32 (3 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations/association_proxy.rb (modified) (1 diff)
- trunk/activerecord/test/associations_test.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r3035 r3043 1 1 *SVN* 2 3 * Associations handle case-equality more consistently: item.parts.is_a?(Array) and item.parts === Array. #1345 [MarkusQ@reality.com] 2 4 3 5 * SQLServer: insert uses given primary key value if not nil rather than SELECT @@IDENTITY. #2866 [kajism@yahoo.com, Tom Ward <tom@popdog.net>] trunk/activerecord/lib/active_record/associations/association_proxy.rb
r2861 r3043 18 18 end 19 19 20 def respond_to?(symbol, include_priv = false) 21 proxy_respond_to?(symbol, include_priv) || (load_target && @target.respond_to?(symbol, include_priv)) 22 end 23 24 # Explicitly proxy === because the instance method removal above 25 # doesn't catch it. 26 def ===(other) 27 load_target 28 other === @target 29 end 30 20 31 def reload 21 32 reset 22 33 load_target 23 end24 25 def respond_to?(symbol, include_priv = false)26 proxy_respond_to?(symbol, include_priv) || (load_target && @target.respond_to?(symbol, include_priv))27 34 end 28 35 trunk/activerecord/test/associations_test.rb
r2974 r3043 80 80 def test_triple_equality 81 81 assert Account === companies(:first_firm).account 82 assert companies(:first_firm).account === Account 82 83 end 83 84 … … 279 280 def test_finding 280 281 assert_equal 2, Firm.find(:first).clients.length 282 end 283 284 def test_triple_equality 285 assert !(Array === Firm.find(:first).clients) 286 assert Firm.find(:first).clients === Array 281 287 end 282 288 … … 748 754 end 749 755 756 def test_triple_equality 757 assert Client.find(3).firm === Firm 758 assert Firm === Client.find(3).firm 759 end 760 750 761 def test_type_mismatch 751 762 assert_raise(ActiveRecord::AssociationTypeMismatch) { Account.find(1).firm = 1 } … … 1025 1036 assert_equal 2, active_record.developers.size 1026 1037 assert active_record.developers.include?(david) 1038 end 1039 1040 def test_triple_equality 1041 assert !(Array === Developer.find(1).projects) 1042 assert Developer.find(1).projects === Array 1027 1043 end 1028 1044