1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #17009 from arthurnn/foreign_key_symbols

Fixtures using Foreign key symbols
This commit is contained in:
Rafael Mendonça França 2014-09-22 14:23:40 -03:00
commit b61a2db8d0
3 changed files with 3 additions and 3 deletions

View file

@ -661,7 +661,7 @@ module ActiveRecord
row[association.foreign_type] = $1
end
fk_type = association.active_record.columns_hash[association.foreign_key].type
fk_type = association.active_record.columns_hash[fk_name].type
row[fk_name] = ActiveRecord::FixtureSet.identify(value, fk_type)
end
when :has_many

View file

@ -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

View file

@ -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