I'd like to use searchlogic's scope_procedure
feature like so
class MyModelObject < ActiveRecord::Base
scope_procedure :my_scope_proc, lambda { |p1, p2| { :conditions => "p1 >= #{p1} AND p2 < #{p2}" }}
end
Then, I am doing the search:
scope = MyModelObject.search(:my_scope_proc => true)
scope.all
The above code obviously doesn't work because I didn't pass p1
and p2
parameters to my named scope.
I can't figure out how to pass parameters to the named scope.