mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't use arel_table in published_and_commented example in querying guide
This commit is contained in:
parent
83d4ce6a25
commit
ef493c9259
1 changed files with 1 additions and 1 deletions
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue