Created
February 20, 2009 22:48
-
-
Save jferris/67763 to your computer and use it in GitHub Desktop.
This file contains 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
User.admins # return all admins | |
User.editors # return all editors | |
User.admins.editors # return all users that are admins and editors | |
User.not.admins # return all users that are not admins | |
User.admins.or.editors # return all users that are admins or editors | |
class Job < ActiveRecord::Base | |
def search(options) | |
Job. | |
active.unless { options[:include_inactive] }. | |
group {|jobs| | |
jobs. | |
titled(options[:title]).or. | |
matching_company_name(options[:company]).or. | |
tagged_with(options[:tags]) | |
} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment