aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorEloy Duran <eloy.de.enige@gmail.com>2010-01-08 21:44:06 +0100
committerEloy Duran <eloy.de.enige@gmail.com>2010-01-08 21:47:17 +0100
commit7f775ef1a92129fcc77079bc8e00c99a75b38a38 (patch)
tree549b2e03c1fbaa8890a70e30c4c5370160c7daaf /activerecord/lib/active_record/reflection.rb
parentf2aacd51405724cdf7cfd36a439c9dbfce16973a (diff)
downloadrails-7f775ef1a92129fcc77079bc8e00c99a75b38a38.tar.gz
rails-7f775ef1a92129fcc77079bc8e00c99a75b38a38.tar.bz2
rails-7f775ef1a92129fcc77079bc8e00c99a75b38a38.zip
Renamed AssociationReflection #collection_association? to #collection?.
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index d6fad5cf29..32b9a2aa87 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -255,11 +255,11 @@ module ActiveRecord
# Returns whether or not this association reflection is for a collection
# association. Returns +true+ if the +macro+ is one of +has_many+ or
# +has_and_belongs_to_many+, +false+ otherwise.
- def collection_association?
- if @collection_association.nil?
- @collection_association = [:has_many, :has_and_belongs_to_many].include?(macro)
+ def collection?
+ if @collection.nil?
+ @collection = [:has_many, :has_and_belongs_to_many].include?(macro)
end
- @collection_association
+ @collection
end
# Returns whether or not the association should be validated as part of
@@ -278,7 +278,7 @@ module ActiveRecord
private
def derive_class_name
class_name = name.to_s.camelize
- class_name = class_name.singularize if collection_association?
+ class_name = class_name.singularize if collection?
class_name
end