On Apr 10, 4:38 pm, Nick <n...@deadorange.com> wrote:
> > On Apr 10, 11:06 am, "kel...@gmail.com" <kel...@gmail.com> wrote: > > > Did you try require_dependency instead of require? > > I've never heard of require_dependency. I just gave it a try, but > unfortunately, all requests but the first result in this error: > > "A copy of ActsAsDashboard::ClassMethods has been removed from the > module tree but is still active!" > > That behaviour also occurs when I put this in environment.rb: > > ActiveSupport::Dependencies.explicitly_unloadable_constants << > 'ActsAsDashboard' Just for your enlightenment, a big part of the problem is that you were including your module in ActionController::Base. This was problematic because the rails framework (including ActionController::Base) doesn't get reloaded, but you were forcing Rails to reload your module event though ActionController::Base was still hanging onto it (you wouldn't have had this issue if you'd included it in ApplicationController. Using require rather than require_dependency sidesteps Rails' dependency stuff (which is the thing that manages code reloading) Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.