Hi!
On Sat, Oct 21, 2006 at 07:11:00PM +0200, Alfred Toh wrote:
> Ok.. after digging more into acts_as_ferret.rb, I realize I can add an
> attr_accessor for @results
>
> Any reason/problem that I shouldn't be doing that that since it was not
> left out in the latest release?
There's no need to do this, as the SearchResults class hands through all
method calls to @results by overriding method_missing. Just use the
SearchResults instance as you would use an array.
> Another problem I'm having now is to sort the result by using the
> find_options
>
> find_options is a hash passed on to active_record’s find when retrieving
> the data from db, useful to i.e. prefetch relationships.
>
> but I wasn't able to get it to work with :order by doing this...
>
> moto=Pay.find_by_contents("motorola",:limit=>:all,:order=>"salary DESC")
try
moto=Pay.find_by_contents("motorola",{},{ :limit=>:all,:order=>"salary DESC" })
there's two optional hash arguments to find_by_contents, the first one
being ferret_options, and the second one the find_options. As this
problem arises quite often, I start thinking about merging them together
into one in future versions.
cheers,
Jens
--
webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [EMAIL PROTECTED]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk