Chris Richards
2006-May-08 10:11 UTC
[Rails] Files in LIB folder do not seem to update even in DEV mode!!
Hi When i change my classes in the LIB folder they are not updating on the server. My server is in development mode. Any ideas why? Any help is appreciated Thanks, Chris -- Posted via http://www.ruby-forum.com/.
Jonathan Viney
2006-May-08 10:28 UTC
[Rails] Files in LIB folder do not seem to update even in DEV mode!!
You need to include Reloadable in any classes that you want reloaded with each request. Some classes, like ActiveRecord, include this already. class MyClass include Reloadable end -Jonny. On 5/8/06, Chris Richards <evilgeenius@gmail.com> wrote:> Hi > > When i change my classes in the LIB folder they are not updating on the > server. My server is in development mode. Any ideas why? > > Any help is appreciated > Thanks, > Chris > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Chris Richards
2006-May-08 10:48 UTC
[Rails] Re: Files in LIB folder do not seem to update even in DEV mo
Thanks Jonny. It seems a strange to have to do. Surely in development mode it should reload all your classes on each request? is this not the point of development mode? So, i have to inlude "include Reloadable" in the classes i want to reload while i am developing. And then when i go into production mode i will remove the code. Seems plain wrong. -- Posted via http://www.ruby-forum.com/.
j`ey
2006-May-08 10:58 UTC
[Rails] Re: Files in LIB folder do not seem to update even in DEV mo
Chris Richards wrote:> Thanks Jonny. > > It seems a strange to have to do. Surely in development mode it should > reload all your classes on each request? is this not the point of > development mode? > > So, i have to inlude "include Reloadable" in the classes i want to > reload while i am developing. And then when i go into production mode i > will remove the code. Seems plain wrong.Model files can only reload becasue they inherit from ActiveRecord::Base, to Rails knows about them, but it doesn''t know about files that don''t inherit from that. J`ey http://www.eachmapinject.com -- Posted via http://www.ruby-forum.com/.
Jonathan Viney
2006-May-08 12:43 UTC
[Rails] Re: Files in LIB folder do not seem to update even in DEV mo
I don''t know enough about it to tell you why Rails doesn''t simply remove everything and start again, but I''m sure there are reasons. You don''t need to remove the ''include Reloadable'' line when in production. The code which reloads the classes simply isn''t called when in production. You can remove it if you want, but you don''t have to. -Jonny. On 5/8/06, Chris Richards <evilgeenius@gmail.com> wrote:> Thanks Jonny. > > It seems a strange to have to do. Surely in development mode it should > reload all your classes on each request? is this not the point of > development mode? > > So, i have to inlude "include Reloadable" in the classes i want to > reload while i am developing. And then when i go into production mode i > will remove the code. Seems plain wrong. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Wilson Bilkovich
2006-May-08 13:48 UTC
[Rails] Re: Files in LIB folder do not seem to update even in DEV mo
Imagine a file in your lib folder that had this in it: class Scary File.delete "/something/important.cfg" end ..or class Spam MyMailModel.deliver_spam end You''d want to be pretty sure you wanted to reload those automatically before letting it happen. On 5/8/06, Jonathan Viney <jonathan.viney@gmail.com> wrote:> I don''t know enough about it to tell you why Rails doesn''t simply > remove everything and start again, but I''m sure there are reasons. > > You don''t need to remove the ''include Reloadable'' line when in > production. The code which reloads the classes simply isn''t called > when in production. You can remove it if you want, but you don''t have > to. > > -Jonny. > > On 5/8/06, Chris Richards <evilgeenius@gmail.com> wrote: > > Thanks Jonny. > > > > It seems a strange to have to do. Surely in development mode it should > > reload all your classes on each request? is this not the point of > > development mode? > > > > So, i have to inlude "include Reloadable" in the classes i want to > > reload while i am developing. And then when i go into production mode i > > will remove the code. Seems plain wrong. > > > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >