To edit pages or tickets please login with username/password: aaf/aaf

Ticket #211 (closed enhancement: worksforme)

Opened 8 months ago

Last modified 7 months ago

Can AAF scope queries?

Reported by: aaf Assigned to: jk
Priority: major Milestone: 0.4.2
Component: 0plugin Version:
Keywords: Cc: james.bebbington@gmail.com

Description

Is it currently possible to do the following?

Where Foo has_many => :bars

Foo.find(1).bars.find_with_ferret 'moo'

When trying to do so using either the latest stable release or r333 I get:

NoMethodError: protected method `with_scope' called for #<Class:0xb6f4b79c>
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1532:in `method_missing_without_paginate'
	from /<project_dir>/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:139:in `method_missing'
	from /<project_dir>/vendor/plugins/facetime/lib/facebook_model/active_record_extensions.rb:47:in `method_missing_without_paginate'
	from /<project_dir>/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:139:in `method_missing'
	from (irb):1

I see that r332 applies a scope patch, so I'm guessing that AAF either did support scoping (but got broken by Rails 2.0) or that it is planned in the future. Can anyone enlighten me please?

Thanks,

James.

Change History

04/12/08 06:11:31 changed by jk

  • status changed from new to closed.
  • resolution set to worksforme.

Yes, aaf supports this kind of scoping. There's also a test case (test_find_with_ferret_on_has_many_assoc) in content_test.rb that works fine here (with Rails 2.0).

As aaf does never call with_scope, I guess the problem lies somewhere else.

To edit pages or tickets please login with username/password: aaf/aaf