aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-06-30 19:38:20 +0200
committerJosé Valim <jose.valim@gmail.com>2010-07-01 00:09:55 +0200
commit57d750edf7c71e001ac314fa188aa1fc6292f8ab (patch)
tree5dc0c5492d1ee0ac09ef6abbb67871c0ddf7ae62 /activerecord/lib/active_record/base.rb
parentc63cf7bf0db708fe46a929cf57649ab5a92034af (diff)
downloadrails-57d750edf7c71e001ac314fa188aa1fc6292f8ab.tar.gz
rails-57d750edf7c71e001ac314fa188aa1fc6292f8ab.tar.bz2
rails-57d750edf7c71e001ac314fa188aa1fc6292f8ab.zip
Make relation a private method.
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index c8795e4496..c868ff3ae8 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -896,11 +896,6 @@ module ActiveRecord #:nodoc:
store_full_sti_class ? name : name.demodulize
end
- def relation
- @relation ||= Relation.new(self, arel_table)
- finder_needs_type_condition? ? @relation.where(type_condition) : @relation
- end
-
def arel_table
@arel_table ||= Arel::Table.new(table_name, :engine => arel_engine)
end
@@ -941,6 +936,12 @@ module ActiveRecord #:nodoc:
end
private
+
+ def relation #:nodoc:
+ @relation ||= Relation.new(self, arel_table)
+ finder_needs_type_condition? ? @relation.where(type_condition) : @relation
+ end
+
# Finder methods must instantiate through this method to work with the
# single-table inheritance model that makes it possible to create
# objects of different types from the same table.