diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-09 23:34:06 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-09 23:34:06 -0300 |
commit | bcbc4f44ec24b52f75361e6342f063ad8e3892c7 (patch) | |
tree | dabee54d5ac2646f69309e12b856b9c378662503 /activerecord/lib/active_record/associations/association.rb | |
parent | e1175d99e2c2813b248475fd0234818cd3b3e386 (diff) | |
parent | bfd0159413ac7941c80166b41856795d93158bb1 (diff) | |
download | rails-bcbc4f44ec24b52f75361e6342f063ad8e3892c7.tar.gz rails-bcbc4f44ec24b52f75361e6342f063ad8e3892c7.tar.bz2 rails-bcbc4f44ec24b52f75361e6342f063ad8e3892c7.zip |
Merge pull request #15597 from eileencodes/reuse-available-collection-methods
reuse available collection? check instead of macro
Diffstat (limited to 'activerecord/lib/active_record/associations/association.rb')
-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 89cbb50035..f1c36cd047 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -179,7 +179,7 @@ module ActiveRecord def creation_attributes attributes = {} - if (reflection.has_one? || reflection.macro == :has_many) && !options[:through] + if (reflection.has_one? || reflection.collection?) && !options[:through] attributes[reflection.foreign_key] = owner[reflection.active_record_primary_key] if reflection.options[:as] |