Skip to content

Instantly share code, notes, and snippets.

@yyalim
Created July 24, 2015 10:30
Show Gist options
  • Save yyalim/bbfa04671f740c0cb0af to your computer and use it in GitHub Desktop.
Save yyalim/bbfa04671f740c0cb0af to your computer and use it in GitHub Desktop.
Week.where{ matches_count.eq 0 }
# Week Load (1.0ms) SELECT "weeks".* FROM "weeks"
# => #<ActiveRecord::QueryMethods::WhereChain:0x007fee87784fd8 @scope=#<ActiveRecord::Relation [#<Week id: 6, created_at: "2015-07-24 09:39:24", updated_at: "2015-07-24 09:39:24", matches_count: 2>, #<Week id: 1, created_at: "2015-07-24 09:39:24", updated_at: "2015-07-24 09:39:24", matches_count: 2>, #<Week id: 5, created_at: "2015-07-24 09:39:24", updated_at: "2015-07-24 09:39:24", matches_count: 2>, #<Week id: 3, created_at: "2015-07-24 09:39:24", updated_at: "2015-07-24 09:39:24", matches_count: 2>, #<Week id: 4, created_at: "2015-07-24 09:39:24", updated_at: "2015-07-24 09:39:24", matches_count: 2>, #<Week id: 2, created_at: "2015-07-24 09:39:24", updated_at: "2015-07-24 09:39:24", matches_count: 2>]>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment