Hi!
Yeah, I experimented with this and it should work as intended. However
I'm not sure I like it the way it is now - imho it would be cleaner to
have not only conditions on a per model basis, but other AR options like
include or group_by, too.
That's why I didn't announce this feature yet, I just wanted to think
about it a bit more ;-)
One way to specify these per-model options might with in the :multi
option:
find_with_ferret query, :multi => {
:model_a => { :conditions => ['a=?', a_Value ] },
:model_b => { :include => :some_relationship }
}
What do you think?
Cheers,
Jens
On Tue, Dec 18, 2007 at 07:35:25AM +0100, Sheldon Maloff wrote:
> Jens Krämer wrote:
>
> > Afair there's already a trac ticket regarding the implementation of
> > per-model conditions for multi search, but I didn't find the time to
> > implement this yet. I'll try to have a look into this over the weekend.
>
> Hey Jens, did you actually manage to get to this over the weekend? I was
> looking over the code in your RDOC for AAF, and I saw the following in
> class_methods.rb, line 377:
>
> # check for per-model conditions and take these if provided
> if conditions = find_options[:conditions]
> key = model.underscore.to_sym
> conditions = conditions[key] if Hash === conditions
> end
>
> And then I noticed my copy of the code (from stable release) didn't have
> those lines. So I update to the bleeding edge of trunk, and it sure
> looks like per-model conditions are in place and working (at least with
> my set of models they appear to be working).
>
> So, are per-model conditions working as you would expect them to be
> working? Or am I completely out to lunch and imagining things?
>
> - Sheldon Maloff
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
--
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
Amtsgericht Dresden | HRB 15422
GF Sven Haubold
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk