aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-07-08 10:09:39 -0400
committerNeeraj Singh <neerajdotname@gmail.com>2010-07-08 10:09:39 -0400
commit4a1207d54077348b67fad95ffde5710cf0be31bd (patch)
treede721528fa81f1dfe50449c2d5c3985f513e83cd /activerecord/lib/active_record/base.rb
parentf6fa6cf6117e691899c821b8999bd7dfb3f48b38 (diff)
parentdc364fdc595405aa3d5735e60d46ad3f9544a65b (diff)
downloadrails-4a1207d54077348b67fad95ffde5710cf0be31bd.tar.gz
rails-4a1207d54077348b67fad95ffde5710cf0be31bd.tar.bz2
rails-4a1207d54077348b67fad95ffde5710cf0be31bd.zip
Merge branch 'master' of github.com:lifo/docrails
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 9860c3c725..3f1015dd4b 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -898,11 +898,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
@@ -943,6 +938,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.