mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Better regression test for Fixtures with fk as a symbol
This commit is contained in:
parent
2a1b45af56
commit
c36ca0547f
2 changed files with 2 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue