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
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.
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:in
method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_conditions.rb:19:inmethod_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_ordering.rb:27:in
method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/ordering.rb:30:inmethod_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/or_conditions.rb:24:in
method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:inmethod_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:in
method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_conditions.rb:46:insend' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/association_conditions.rb:46:in
association_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:increate_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:in
method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/ordering.rb:30:inmethod_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/searchlogic-2.3.5/lib/searchlogic/named_scopes/or_conditions.rb:24:in
method_missing' from /Users/ctaylor/.rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:inmethod_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:in
method_missing' from (irb):34End Error: