Public Gists by matthuhiggins

Gravatar
Thu May 14 10:28:25 -0700 2009
1
2
3
module StrictlyUntyped
  module ConditionsScope
    # Makes it easy to add scopes which are only conditions.
Gravatar
Thu May 14 10:26:34 -0700 2009
1
2
3
def named_conditions(name, conditions, &block)
  named_scope(name, case conditions
      when Hash
Gravatar
Thu May 14 10:25:27 -0700 2009
1
2
3
class ActiveRecord::Base
  named_scope :conditions, lambda { |*args| {:conditions => args} }
end
Gravatar
Thu May 14 10:06:00 -0700 2009
1
puts "hello