diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2012-04-07 11:23:47 -0500 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2012-04-07 11:29:18 -0500 |
commit | ef493c9259d62a761257de7ffd04258811a9f233 (patch) | |
tree | 186b7819786274bdb0e46771cd2f11e75a92b829 | |
parent | 83d4ce6a25efff9ae803a08a9895531aaecacd3c (diff) | |
download | rails-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.textile | 2 |
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> |