Created
October 28, 2013 16:25
-
-
Save clamstew/7199992 to your computer and use it in GitHub Desktop.
Using staby lambda to put scope on the model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Task < ActiveRecord::Base | |
belongs_to :project | |
belongs_to :employee | |
scope :complete, ->{ where(complete: true) } | |
scope :incomplete, ->{ where(complete: false) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment