Development environment bug? (config.load_paths doesn't take)

This works for me in production but not development.

Problem:
I have a need to group models into subdirectories which in no way map
to models.

Suggested solution (as per article):
Add the following code to the Rails::Initializer.run block in
environment.rb:

config.frameworks -= [ :action_web_service ]

config.load_paths += %W[
#{RAILS_ROOT}/app/models/helpers
#{RAILS_ROOT}/app/models/autogenerated
#{RAILS_ROOT}/app/models/database
]

New Problem:
In development mode, these new directories are not picked up.

I’ve tried to trace the flow, but no love.

In development mode, these new directories are not picked up.

Hi, anyone has an answer for this one?
I just tried to add some new path same way and it doesn’t seem to pick
it. Running in development mode yet.

Thanks.

On Jan 4, 6:04Â am, comopasta Gr [email protected] wrote:

In development mode, these new directories are not picked up.

Hi, anyone has an answer for this one?
I just tried to add some new path same way and it doesn’t seem to pick
it. Running in development mode yet.

You’ve posted a quote from someplace, likely this list, but without
any way to reference the original post. Can you give more details?

–Matt J.

On Tue, Jan 5, 2010 at 8:37 PM, Matt J. [email protected] wrote:

You’ve posted a quote from someplace, likely this list, but without
any way to reference the original post. Can you give more details?

–Matt J.

Yes, I agree with Matt that’s it’s hard to following the discussion
without
knowing
the original issue.

-Conrad

I’m not sure about your specific problem, but you could try replacing
your code with the following:

config.load_paths += Dir["#{RAILS_ROOT}/app/models//"]

That loads all files in all subdirs in your models directory. It
works for me in all environments (in Rails 2.3, at least, haven’t
tried it on earlier versions).

Casey

:smiley: :smiley:

I can’t deny you are right guys.
The quote is taken about 100 pixels above my text. It is part of the
original question of the post (almost the last line in it). I don’t
really like quoting whole texts because it duplicates all the stuff…

If for some reason you can’t see the original question I paste it here
again.


Posted by Student (Guest) on 17.10.2007 18:04
This works for me in production but not development.

Problem:
I have a need to group models into subdirectories which in no way map
to models.

Suggested solution (as per article):
Add the following code to the Rails::Initializer.run block in
environment.rb:

config.frameworks -= [ :action_web_service ]

config.load_paths += %W[
#{RAILS_ROOT}/app/models/helpers
#{RAILS_ROOT}/app/models/autogenerated
#{RAILS_ROOT}/app/models/database
]

New Problem:
In development mode, these new directories are not picked up.

I’ve tried to trace the flow, but no love.


Cheers.

On Jan 6, 10:30Â am, comopasta Gr [email protected] wrote:

:smiley: :smiley:

I can’t deny you are right guys.
The quote is taken about 100 pixels above my text. It is part of the
original question of the post (almost the last line in it). I don’t
really like quoting whole texts because it duplicates all the stuff…

If for some reason you can’t see the original question I paste it here
again.

Just to be sure, have you restarted your app after changing
environment.rb ?

Fred