[Comatose] Comatose breaks model plugin

Martin Honermeyer maze at strahlungsfrei.de
Mon Jul 24 06:28:42 EDT 2006


Hello,

I am trying to use Comatose 0.6 with the "has_enumerated" plugin 
(http://svn.protocool.com/rails/plugins/enumerations_mixin/trunk/):

script/console
Loading development environment.
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:1129:in 
`method_missing':NoMethodError: undefined method `has_enumerated' for 
OrderItem:Class
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:1129:in 
`method_missing':NoMethodError: undefined method `has_enumerated' for 
OrderItem:Class

This happens with Rails 1.1.4 as well as with Edge.

This is a problem I have experienced with Observers before. Seems like some 
plugins (and the Observer class) are breaking extensions which modify 
ActiveRecord::Base. This may be a Rails bug. It has been reported already: 
http://dev.rubyonrails.org/ticket/5279

I have a naughty workaround in environment.rb (at the beginning, even 
before "boot" is required:

module ActiveRecord
  class Base ; end
end

class OrderItem < ActiveRecord::Base
  def self.has_enumerated(dummy)
  end
end

This makes it work with my OrderItem class. 

There has to be way Comatose can be changed in order to circumvent this 
problem? Anyone got a hint?

Greetings,
Martin Honermeyer

---
IT-Manager
School-Scout.de
Linckensstr. 187
48165 Münster
Tel  +49 (0) 2501 - 444777
Fax  +49 (0) 2501 - 25852	


More information about the Comatose-Users mailing list