aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-08 09:51:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-08 09:51:48 -0700
commit6ffce1791ab989afb0f3bc1dd579804fc9a5c756 (patch)
treef70fe3247765badcb144ebc6a693a5870ae80055 /activerecord/test/cases
parent83e0544204a1b0125af15e1ea0e54aa30b2266ab (diff)
downloadrails-6ffce1791ab989afb0f3bc1dd579804fc9a5c756.tar.gz
rails-6ffce1791ab989afb0f3bc1dd579804fc9a5c756.tar.bz2
rails-6ffce1791ab989afb0f3bc1dd579804fc9a5c756.zip
set a constant for the "anonymous" habtm model fixes #15022
I wanted the middle model to be anonymous, but we have to give it a name for marshal support. :'(
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb6
1 files changed, 6 insertions, 0 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 c166fe87e8..cfdfff6af9 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
@@ -83,6 +83,12 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
country.treaties << treaty
end
+ def test_marshal_dump
+ post = posts :welcome
+ preloaded = Post.includes(:categories).find post.id
+ assert_equal preloaded, Marshal.load(Marshal.dump(preloaded))
+ end
+
def test_should_property_quote_string_primary_keys
setup_data_for_habtm_case