Hi,
I have many many models (''cos of SIngle Table Inheritance), and I want
to organize the various subclasses together in subfolders in the
app/models folder.
SO e.g.
app/models/status.rb
app/models/statuses/open.rb
app/models/statuses/closed.rb
This USED to work in an older revision of Rails, but no longer works in
Edge.
How can I make this work, so that Rails automagically recognizes my
subclassed models in the app/models/statuses subfolder .... ?
Thanks
Joerg
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Joerg Diekmann wrote:> Hi, > > I have many many models (''cos of SIngle Table Inheritance), and I want > to organize the various subclasses together in subfolders in the > app/models folder. > > SO e.g. > > app/models/status.rb > app/models/statuses/open.rb > app/models/statuses/closed.rb > > > This USED to work in an older revision of Rails, but no longer works in > Edge. > > How can I make this work, so that Rails automagically recognizes my > subclassed models in the app/models/statuses subfolder .... ? > > Thanks > JoergYou should have a line in your environment.rb that is commented out that says something about load_paths: # Add additional load paths for your own custom dirs config.load_paths += ["#{RAILS_ROOT}/app/models/sweepers/"] Add your custom load paths there. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Works thanks. I was just under the impression that it automatically includes all subfolders as well ... well, that''s how it used to work anyway. Shot. Alex Wayne wrote:> You should have a line in your environment.rb that is commented out that > says something about load_paths: > > # Add additional load paths for your own custom dirs > config.load_paths += ["#{RAILS_ROOT}/app/models/sweepers/"] > > Add your custom load paths there.-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
It used to. I believe it was removed for security reasons<br>
<br>
Joerg Diekmann wrote:
<blockquote
cite="mid828e2feda23ab8d464c2673ae6c49a64-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org"
type="cite">
<pre wrap="">Works thanks. I was just under the impression
that it automatically
includes all subfolders as well ... well, that''s how it used to work
anyway. Shot.
Alex Wayne wrote:
</pre>
<blockquote type="cite">
<pre wrap="">You should have a line in your environment.rb
that is commented out that
says something about load_paths:
# Add additional load paths for your own custom dirs
config.load_paths += ["#{RAILS_ROOT}/app/models/sweepers/"]
Add your custom load paths there.
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
--~--~---------~--~----~------------~-------~--~----~<br>
You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group. <br> To post to this
group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
<br> To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br>
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en <br>
-~----------~----~----~----~------~----~------~--~---<br>
</body>
</html>
<br>