aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2012-04-07 11:23:47 -0500
committerRyan Bigg <radarlistener@gmail.com>2012-04-07 11:29:18 -0500
commitef493c9259d62a761257de7ffd04258811a9f233 (patch)
tree186b7819786274bdb0e46771cd2f11e75a92b829
parent83d4ce6a25efff9ae803a08a9895531aaecacd3c (diff)
downloadrails-ef493c9259d62a761257de7ffd04258811a9f233.tar.gz
rails-ef493c9259d62a761257de7ffd04258811a9f233.tar.bz2
rails-ef493c9259d62a761257de7ffd04258811a9f233.zip
Don't use arel_table in published_and_commented example in querying guide
-rw-r--r--guides/source/active_record_querying.textile2
1 files changed, 1 insertions, 1 deletions
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:
<ruby>
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
</ruby>