In this particular case, I have a model which "acts_as_mappable" - this
plugin adds special geocoding-related options to AR::Base.find(). So I
needed to filter my list based on a distance from a given point, and so
I need to be able to pass these custom geocoding-related options.
I am going to submit a pull request for the patch I wrote. Simply a
method called "custom_finder_options" that gets invoked in AS's
"find_page" method. Here's the implementation for my particular case:
def custom_finder_options
@location_specified ? {:within => @within.to_i, :origin =>
[...@from_lat, @from_lng], :order => 'distance'} : {}
end
Thanks for the help.
Wes
Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
wrote:
> El Monday 23 March 2009 16:19:36 Wes Gamble escribió:
>
>> All,
>>
>> I've decided that I have a requirement to pass arbitrary AR::Base.find()
>> options to the find that AS does in order to generate the "list" view.
>>
>
> What you need pass which is not possible currently with
> active_scaffold_conditions and active_scaffold_joins?
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---