aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/association.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2011-04-12 21:56:00 -0500
committerJoshua Peek <josh@joshpeek.com>2011-04-12 21:56:00 -0500
commited24595647374885cebc1d43badc174c0991e93a (patch)
tree020a8c856c264ed34deb872e54cf447e2fd872a3 /activerecord/lib/active_record/associations/association.rb
parentd7b521db1297c1b95a441b3928fc31ab3abd5ed5 (diff)
parentf0e198bfa1e3f9689e0cde1d194a44027fc90b3c (diff)
downloadrails-ed24595647374885cebc1d43badc174c0991e93a.tar.gz
rails-ed24595647374885cebc1d43badc174c0991e93a.tar.bz2
rails-ed24595647374885cebc1d43badc174c0991e93a.zip
Merge branch 'master' into sprockets
Diffstat (limited to 'activerecord/lib/active_record/associations/association.rb')
-rw-r--r--activerecord/lib/active_record/associations/association.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb
index 27c446b12c..66f6477ec5 100644
--- a/activerecord/lib/active_record/associations/association.rb
+++ b/activerecord/lib/active_record/associations/association.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/array/wrap'
+require 'active_support/core_ext/object/inclusion'
module ActiveRecord
module Associations
@@ -163,7 +164,7 @@ module ActiveRecord
def creation_attributes
attributes = {}
- if [:has_one, :has_many].include?(reflection.macro) && !options[:through]
+ if reflection.macro.among?(:has_one, :has_many) && !options[:through]
attributes[reflection.foreign_key] = owner[reflection.active_record_primary_key]
if reflection.options[:as]