On 31 Dec 2008, at 06:08, Sijo Kg wrote:
> I have found the the below code in environment.rb Here used
> subdirectories to better organize files
>
> Dependencies.load_paths += [
> File.join(RAILS_ROOT, "app/models/Dir1"), File.join(RAILS_ROOT,
> "app/models/Dir2")
> ]
>
> What I understood is Rails includes /app/models in the load_path
> automatically however it does not include subdirectories. Is it
> right? I
> would like to know there is a better way on handling that, either by
> generically loading all subdirectories or by having 1 file in the
> app/models directory load the files in the subdirectory
This would probably work:
config.load_paths += Dir["#{RAILS_ROOT}/app/models/**/**"]
Best regards
Peter De Berdt
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---