I have a Rails scope:
scope :positive_amount, -> { where("amount > 0") }
But when I do:
Transaction.method(:positive_amount).source.display
I get:
singleton_class.send(:define_method, name) do |*args|
scope = all
scope = scope._exec_scope(*args, &body)
scope = scope.extending(extension) if extension
scope
end
Not the -> { where("amount > 0") } that I'd like.
Any ideas?