diff options
author | Kassio Borges <kassioborgesm@gmail.com> | 2014-04-25 17:34:13 -0300 |
---|---|---|
committer | Kassio Borges <kassioborgesm@gmail.com> | 2014-04-25 17:34:13 -0300 |
commit | 18fa87b8663ac88fd280e9860505598fe04cd46a (patch) | |
tree | ea0d8320a94ce470d1320f63f882285b4f58fc51 /activerecord/test | |
parent | 7fe5ae8d237c8f821bc5e984f98d9d7eb7c35266 (diff) | |
download | rails-18fa87b8663ac88fd280e9860505598fe04cd46a.tar.gz rails-18fa87b8663ac88fd280e9860505598fe04cd46a.tar.bz2 rails-18fa87b8663ac88fd280e9860505598fe04cd46a.zip |
Fix custom join_table name on habtm reflections
When used a custom join_table name on a habtm, rails was not saving it
on Reflections. This causes a problem when rails loads fixtures, because
it uses the reflections to set database with fixtures.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | 5 |
1 files changed, 5 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 366472c6fd..5d33634da2 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 @@ -21,6 +21,7 @@ require 'models/membership' require 'models/sponsor' require 'models/country' require 'models/treaty' +require 'models/vertex' require 'active_support/core_ext/string/conversions' class ProjectWithAfterCreateHook < ActiveRecord::Base @@ -819,4 +820,8 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert_equal 1, treasure.rich_people.size assert_equal person_first_name, rich_person.first_name, 'should not run associated person validation on update when validate: false' end + + def test_custom_join_table + assert_equal 'edges', Vertex.reflect_on_association(:sources).join_table + end end |