On Jan 13, 2008, at 6:15 AM, ara.t.howard wrote:

> let me explain:  it's bothered me to no end that rails doesn't really
> support any sort of centralized view of what the hell and application
> does, especially for a developer inheriting a project.
> application.rb is a nice spot not only for sharing behavior across
> controllers, but also for monkey patching junk in in a way that
> people are likely to notice it.

In my view ApplicationController is just about controllers, inheriting  
filters, common utilities, etc. I believe any other application-wide  
stuff like monkey-patching had a place in Rails pre-2, which was the  
bottom of environment.rb, and now the initializers.

If you are new to a project one of the first things you need to do is  
to open environment.rb/initializers and be aware of custom stuff. I  
had considered reopening String somewhere under app to be a dubious  
practice in the sense that the place is not as conventional as those  
are.

Configuration stuff went somewhere in environment.rb or in some .yml  
under config. If environment.rb got too big you factored something out  
in some file, and require it from environment.rb. But the single entry  
point to see custom extensions and global stuff was still that one,  
you still saw some require "add_unary_minus_to_nilclass.rb" to follow.

In general I think we do have a place for that kind of stuff, so I am  
+1 on the renaming because of the naming coherence.

I agree an abstract ApplicationModel < AR::Base is missing to complete  
a coherent setup. I have not needed such a class very often in  
practice, but I think I've reopened AR::Base a couple of times to do  
what you normally would do via inheritance. In those cases I didn't  
introduce an abstract root model to invest the minimum effort and be  
able to leverage the original generators.

-- fxn


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to