diff options
author | Arthur Neves <arthurnn@gmail.com> | 2014-09-22 13:12:19 -0400 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2014-09-22 13:12:19 -0400 |
commit | c36ca0547f41373fa3cd474722bc51e5446a1630 (patch) | |
tree | 4770cf391aad6a422d02dea7937ab3b10db85ea0 /activerecord | |
parent | 2a1b45af56d6c0ec39941c50ff98bf2e6d74d274 (diff) | |
download | rails-c36ca0547f41373fa3cd474722bc51e5446a1630.tar.gz rails-c36ca0547f41373fa3cd474722bc51e5446a1630.tar.bz2 rails-c36ca0547f41373fa3cd474722bc51e5446a1630.zip |
Better regression test for Fixtures with fk as a symbol
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 11 | ||||
-rw-r--r-- | activerecord/test/models/parrot.rb | 2 |
2 files changed, 2 insertions, 11 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index e96f6cb67a..1050047a43 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -675,7 +675,7 @@ class FoxyFixturesTest < ActiveRecord::TestCase if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' require 'models/uuid_parent' require 'models/uuid_child' - fixtures :uuid_parents, :uuid_children + fixtures :uuid_parents, :uuid_children end def test_identifies_strings @@ -810,15 +810,6 @@ class FoxyFixturesTest < ActiveRecord::TestCase assert admin_accounts(:signals37).users.include?(admin_users(:david)) assert_equal 2, admin_accounts(:signals37).users.size end - - class Nemesis < ActiveRecord::Base - self.table_name = "mateys" - belongs_to :mortal_enemy, :class_name => 'Pirate', :foreign_key => :target_id - end - - def test_symbol_foreign_key_id - ActiveRecord::FixtureSet.create_fixtures(FIXTURES_ROOT, "nemeses", "nemeses" => Nemesis) - end end class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase diff --git a/activerecord/test/models/parrot.rb b/activerecord/test/models/parrot.rb index e76e83f314..8c83de573f 100644 --- a/activerecord/test/models/parrot.rb +++ b/activerecord/test/models/parrot.rb @@ -19,7 +19,7 @@ class LiveParrot < Parrot end class DeadParrot < Parrot - belongs_to :killer, :class_name => 'Pirate' + belongs_to :killer, :class_name => 'Pirate', foreign_key: :killer_id end class FunkyParrot < Parrot |