Created
May 14, 2009 17:26
-
-
Save matthuhiggins/111780 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
def named_conditions(name, conditions, &block) | |
named_scope(name, case conditions | |
when Hash | |
{:conditions => conditions} | |
when Proc | |
lambda { |*args| {:conditions => conditions.call(*args)} } | |
end, &block) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment