Hi all !

I am adding observers to some model objects.  One of these uses
RailsCron. RailsCron adds a class method to ActiveRecord::Base. Unfortunately, during the initialization phase, plugins aren't yet
loaded, so I can't setup my observers in config/environment.rb, as
suggested by the comments.

What's a poor dev to do ?

At the moment, I have fallen back to this:

# Require all models, to speed things up in production and to setup
# all RailsCron tasks, observers.
Dir['app/models/**/*.rb'].each do |f|
 require File.basename(f)
end

Thanks !
--
François Beausoleil
http://blog.teksol.info/
_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to