As it currently stands, ActiveRecord has alot of private and protected
methods in the Base class.

>> ActiveRecord::Base.methods.size
=> 427
>> ActiveRecord::Base.protected_methods.size
=> 32
>> ActiveRecord::Base.private_methods.size
=> 193

I really loved the suggestion by Courtenay in Refactoring
AR::Base.find (http://groups.google.com/group/rubyonrails-core/
browse_thread/thread/2ff2b3ce6732096f/776dae05ffa2d445). It not only
makes extending find calls easier, but all wraps up all the find logic
in one class.

I whipped up a quick example patch for refactoring the calculations
library today. Its still rough and alot of the large methods in there
can now easily be decomposed into short understandable private methods
within the class. I'm planning on refactoring callbacks and
validations similarly to the way I refactored calculations.

Calculations Patch: http://pastie.caboo.se/97034

Is this a good or bad idea? Is there a good reason for the flat
namespace ActiveRecord has?


--~--~---------~--~----~------------~-------~--~----~
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