diff options
author | Wojtek Kruszewski <wojtek@oxos.pl> | 2014-02-21 14:47:39 +0100 |
---|---|---|
committer | Wojtek Kruszewski <wojtek@oxos.pl> | 2014-02-21 15:41:12 +0100 |
commit | dbf9ec071497cd3935c8e5cd59df57f3fd9bbb17 (patch) | |
tree | 20c3b3161f5aefeff4a6d9a950c5f8b9d34092e0 | |
parent | c93c558aa81721653dd18cdc45f3f7299dfa8a72 (diff) | |
download | rails-dbf9ec071497cd3935c8e5cd59df57f3fd9bbb17.tar.gz rails-dbf9ec071497cd3935c8e5cd59df57f3fd9bbb17.tar.bz2 rails-dbf9ec071497cd3935c8e5cd59df57f3fd9bbb17.zip |
Prevent foreign_key_for? from type casting all attributes
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 4e46256862..9ad2d2fb12 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -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, |