Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…uide
  • Loading branch information...
commit ef493c9259d62a761257de7ffd04258811a9f233 1 parent 83d4ce6
Ryan Bigg radar authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  guides/source/active_record_querying.textile
2  guides/source/active_record_querying.textile
Source Rendered
@@ -1004,7 +1004,7 @@ Scopes are also chainable within scopes:
1004 1004 <ruby>
1005 1005 class Post < ActiveRecord::Base
1006 1006 scope :published, -> { where(:published => true) }
1007   - scope :published_and_commented, -> { published.and(self.arel_table[:comments_count].gt(0)) }
  1007 + scope :published_and_commented, -> { published.where("comments_count > 0") }
1008 1008 end
1009 1009 </ruby>
1010 1010

0 comments on commit ef493c9

Please sign in to comment.
Something went wrong with that request. Please try again.