#79 ✓resolved
john (at psynix)

"undefined method `abstract_class?' for Object:Class" with collectiveidea-awesome_nested_set and searchlogic

Reported by john (at psynix) | April 1st, 2009 @ 07:41 AM

I've run into a slight incompatibility with awesome_nested_set (1.1.1), searchlogic (1.6.4) and scoped acts_as_nested_set.

With everything in place:


class SomeModel < ActiveRecord::Base
  acts_as_nested_set :scope => :account
end

Calling any nested set method fails with:


NoMethodError: undefined method `abstract_class?' for Object:Class
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2212:in `class_of_active_record_descendant'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1467:in `base_class'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1143:in `reset_table_name'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1139:in `table_name'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1276:in `columns'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1289:in `column_names'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/searchlogic-1.6.4/lib/searchlogic/conditions/base.rb:106:in `needed?'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/searchlogic-1.6.4/lib/searchlogic/search/base.rb:37:in `needed?'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/searchlogic-1.6.4/lib/searchlogic/active_record/base.rb:159:in `filter_options_with_searchlogic'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/searchlogic-1.6.4/lib/searchlogic/active_record/base.rb:46:in `with_scope'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/named_scope.rb:94:in `named_scope'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/named_scope.rb:177:in `call'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/named_scope.rb:177:in `method_missing'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/collectiveidea-awesome_nested_set-1.1.1/lib/awesome_nested_set.rb:312:in `self_and_descendants'
from /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/collectiveidea-awesome_nested_set-1.1.1/lib/awesome_nested_set.rb:319:in `descendants'

If I remove either the :scope on the nested set or the searchlogic config.gem (installing as a plugin makes no diff btw) then it won't generate any errors.

TIA,

John

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket

Pages