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

undefined method `<=>' error #25

Open
feurio opened this issue Jun 30, 2010 · 3 comments
Open

undefined method `<=>' error #25

feurio opened this issue Jun 30, 2010 · 3 comments

Comments

@feurio
Copy link

feurio commented Jun 30, 2010

For most parts of my rails application cache-money works really nice.

But how do I solve this error. Without cache-money I do not have this error:
(Is there a way to disable cache-money for a certain model?)

NoMethodError (undefined method <=>' for #<UserActivity:0x1072c9b58>): /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/index.rb:124:inadd_object_to_cache'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/index.rb:123:in sort' /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/index.rb:123:inadd_object_to_cache'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/index.rb:161:in update_index_with_minimal_network_operations' /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/index.rb:31:inupdate'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/write_through.rb:60:in update_caches' /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/write_through.rb:60:ineach'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/write_through.rb:60:in update_caches' /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/write_through.rb:48:insend'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/write_through.rb:48:in unfold' /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/write_through.rb:26:inupdate_caches'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cache_money.rb:52:in transaction_without_trace_ActiveRecord_self_name_transaction' /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/transactional.rb:13:intransaction'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cache_money.rb:52:in transaction_without_trace_ActiveRecord_self_name_transaction' /Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.12.3/lib/new_relic/agent/method_tracer.rb:319:intransaction'
/Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.12.3/lib/new_relic/agent/method_tracer.rb:141:in trace_execution_scoped' /Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.12.3/lib/new_relic/agent/method_tracer.rb:314:intransaction'
app/models/user_activity.rb:126:in generate_html' app/models/user_activity.rb:108:increate_html'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cache_money.rb:52:in transaction_without_trace_ActiveRecord_self_name_transaction' /Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cash/transactional.rb:13:intransaction'
/Library/Ruby/Gems/1.8/gems/af-cache-money-0.2.10/lib/cache_money.rb:52:in transaction_without_trace_ActiveRecord_self_name_transaction' /Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.12.3/lib/new_relic/agent/method_tracer.rb:319:intransaction'
/Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.12.3/lib/new_relic/agent/method_tracer.rb:141:in trace_execution_scoped' /Library/Ruby/Gems/1.8/gems/newrelic_rpm-2.12.3/lib/new_relic/agent/method_tracer.rb:314:intransaction'
app/models/activity.rb:151:in `log'

@guilleiguaran
Copy link

I have same bug, maybe it ocurrs in a callback?

@dmilith
Copy link

dmilith commented Sep 13, 2010

same here. Even after removing c-m indices from model! Please help.

@guilleiguaran
Copy link

You must define <=> for ActiveRecord::Base, i do it in cache_money initializer:

 class ActiveRecord::Base
   is_cached :repository => $cache
   def <=>(other)
      self.id <=> other.id
   end
 end 

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

4 participants
@dmilith @feurio @guilleiguaran and others