In order to properly search my Posts using friendly_id, I use this query :
Post.friendly.find(params[:id])
But I need to wrap this method up and send it to my presenter class gem, decent_exposure
. Which gives me a fancy place to include a method
that would fetch my object.
By default, this method is :find
. As written in their code :
def finder
options[:finder] || :find
end
scope.send(finder, id) # scope here would mean Post
How can I send via options, this two method query as a symbol?
Looking at their documentation quickly if you define a class method on Post you should then be able to use that.
Then you can do
Pretty sure this should work.