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

Prevent foreign_key_for? from type casting all attributes

This commit is contained in:
Wojtek Kruszewski 2014-02-21 14:47:39 +01:00
parent c93c558aa8
commit dbf9ec0714

View file

@ -232,7 +232,7 @@ module ActiveRecord
# Returns true if record contains the foreign_key
def foreign_key_for?(record)
record.attributes.has_key? reflection.foreign_key
record.has_attribute?(reflection.foreign_key)
end
# This should be implemented to return the values of the relevant key(s) on the owner,