Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searchlogic doesn't sort on associated model's attribute value #90

Open
conradwt opened this issue May 7, 2010 · 0 comments
Open

Searchlogic doesn't sort on associated model's attribute value #90

conradwt opened this issue May 7, 2010 · 0 comments

Comments

@conradwt
Copy link

conradwt commented May 7, 2010

I'm not sure if this is a bug or not enough documentation which explains how to perform this type of functionality. Also, how does one properly implement the [ descend | ascend ]by* methods for this type of scenario. For example, I have tried the following:

Membership.belongs_to :user
Membership.belongs_to :product # product has a price field associated to it.

Subscription.ascend_by_product_price

Generates the following error message:

Begin Error:

NoMethodError: undefined method ascend_by_price' for #<Class:0x106d73050> from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/conditions.rb:69:inmethod_missing'
from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_conditions.rb:19:in method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_ordering.rb:27:inmethod_missing'
from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/ordering.rb:30:in method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/or_conditions.rb:24:inmethod_missing'
from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in method_missing_without_paginate' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/will_paginate-2.3.11/lib/will_paginate/finder.rb:170:inmethod_missing'
from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_conditions.rb:46:in send' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_conditions.rb:46:inassociation_condition_options'
from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_ordering.rb:39:in create_association_ordering_condition' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_ordering.rb:24:inmethod_missing'
from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/ordering.rb:30:in method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/or_conditions.rb:24:inmethod_missing'
from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in method_missing_without_paginate' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/will_paginate-2.3.11/lib/will_paginate/finder.rb:170:inmethod_missing'
from (irb):34

End Error:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant