
klass.metaclass.class_eval
Reported by Yaraher | December 3rd, 2008 @ 08:56 PM
I'm currently trying Searchlogic but have find to have some issues making it work properly.
After installing it (either by using gem or plugin) it get this error when starting my server:
/Users/alvaropereyrarabanal/Development/SK/vendor/plugins/binarylogic-searchlogic/lib/
searchlogic/conditions/magic_methods.rb:8:in `included': undefined method `metaclass' for
Searchlogic::Conditions::Base:Class (NoMethodError)
which mentions this line:
def self.included(klass)
klass.metaclass.class_eval do
include ClassMethods
attr_accessor :added_column_equals_conditions, :added_associations
end
I tried changing the line to
def self.included(klass)
klass.class_eval do
include ClassMethods
attr_accessor :added_column_equals_conditions, :added_associations
end
and that seemed to at least let me run. However, when trying to search something with it, it can't find the added_associations from my product model (which is obviously something that must be added on the line I modified):
NoMethodError (undefined method `added_associations' for Searchlogic::Cache::ProductConditions:Class):
Is there something wrong I'm doing when trying to start Searchlogic?
Comments and changes to this ticket
-
Ben Johnson December 3rd, 2008 @ 09:18 PM
- State changed from new to resolved
I'm assuming you are using an older version rails that doesn't have meta class. Update from the repository, it should work now. Let me know if you have any probs.
-
Ben Johnson December 3rd, 2008 @ 09:32 PM
It looks like you found a old bug in ActiveRecord. Do you have a funny relationship or something? Because that is a bug had been fixed in later versions. Could you update to 2.1.2 at least? Because there is nothing I can do about that.
-
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.
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.