Ruby on Rails
Thursday, June 7, 2012
You need to use autoload_paths:
config.autoload_paths += %W(#{config.root}/lib)
On Thursday, June 7, 2012 at 12:55 AM, Sub Zero wrote:
I'm completely messed with module reloading in development mode. I haveto restart app server each time I edit lib/z/nginx.rb which is includedin app/models/user_case.rbapp/models/user_case.rbrequire_dependency 'z/nginx'class UserCase < ActiveRecord::Baseinclude Z::NginxunloadableI added to environment.rbconfig.watchable_dirs['lib'] = [:rb]config.watchable_dirs['lib/z'] = [:rb]ActiveSupport::Dependencies.explicitly_unloadable_constants +=%w[Z::Nginx UserCase]But that doesn't work for me. When I change a string value, which isreturned by the module method, I get in a view the old value until appserver restarted.How can I get the new value without restaring app server?Rails 3.2.3--Posted via http://www.ruby-forum.com/.--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-talk@googlegroups.com.To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment