motion/managed_object.rb in cdq-0.1.6 vs motion/managed_object.rb in cdq-0.1.7
- old
+ new
@@ -47,14 +47,14 @@
#
def scope(name, query = nil, &block)
cdq.scope(name, query, &block)
if query
self.class.send(:define_method, name) do
- query
+ where(query)
end
else
self.class.send(:define_method, name) do |*args|
- block.call(*args)
+ where(block.call(*args))
end
end
end
def new(*args)