From ef493c9259d62a761257de7ffd04258811a9f233 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Sat, 7 Apr 2012 11:23:47 -0500 Subject: [PATCH] Don't use arel_table in published_and_commented example in querying guide --- guides/source/active_record_querying.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/active_record_querying.textile b/guides/source/active_record_querying.textile index c5755c8308..de55401c1f 100644 --- a/guides/source/active_record_querying.textile +++ b/guides/source/active_record_querying.textile @@ -1004,7 +1004,7 @@ Scopes are also chainable within scopes: class Post < ActiveRecord::Base scope :published, -> { where(:published => true) } - scope :published_and_commented, -> { published.and(self.arel_table[:comments_count].gt(0)) } + scope :published_and_commented, -> { published.where("comments_count > 0") } end