Created
November 6, 2010 06:09
-
-
Save adamgamble/665229 to your computer and use it in GitHub Desktop.
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 Person < ActiveRecord::Base | |
named_scope hair_color, lambda { |hair_color| { :conditions => ["people.hair_color = ?", hair_color]}} | |
named_scope enjoys_chunky_bacon, lambda { |chunky_bacon_preference| {:conditions => ["people.chunky_bacon_preference = ?", chunky_bacon_prefence]}} | |
named_scope age_between, lambda { |lower_limit, upper_limit| {:conditions => ["people.age BETWEEN ? AND ?", lower_limit, upper_limit]}} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment