Permalink
Browse files

Don't use arel_table in published_and_commented example in querying g…

…uide
  • Loading branch information...
1 parent 83d4ce6 commit ef493c9259d62a761257de7ffd04258811a9f233 @radar radar committed Apr 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 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>

0 comments on commit ef493c9

Please sign in to comment.