aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-05-15 13:13:55 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-05-15 13:13:55 +0530
commit59b03d418ff59fe6bfba6a1b651ef0ac15a2738c (patch)
tree452b7f200c87ea8a7df1d2b651f1d4f0062e50f6 /activerecord/lib/active_record
parent0be7fabd4eb77828e7deff7513faa3834d1a021a (diff)
parent7cd88840939cac913899fa9a11281d78388672ad (diff)
downloadrails-59b03d418ff59fe6bfba6a1b651ef0ac15a2738c.tar.gz
rails-59b03d418ff59fe6bfba6a1b651ef0ac15a2738c.tar.bz2
rails-59b03d418ff59fe6bfba6a1b651ef0ac15a2738c.zip
Merge branch 'master' of github.com:lifo/docrails
Conflicts: actionpack/lib/action_view/helpers/asset_tag_helper.rb
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/core.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index ed555e4bf6..4ebdb04565 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -127,10 +127,18 @@ module ActiveRecord
object.is_a?(self)
end
+ # Returns an instance of +Arel::Table+ loaded with the curent
+ # table name
+ #
+ # class Post < ActiveRecord::Base
+ # scope :published_and_commented, published.and(self.arel_table[:comments_count].gt(0))
+ # end
+ # end
def arel_table
@arel_table ||= Arel::Table.new(table_name, arel_engine)
end
+ # Returns the Arel engine
def arel_engine
@arel_engine ||= connection_handler.retrieve_connection_pool(self) ? self : active_record_super.arel_engine
end