Em 13-09-2009 04:48, Mateo Murphy escreveu:
>> Let me tell you my doubts at the moment. Firstly, I've noted that
>> ActionModel::Errors#full_messages method is overrided in ActiveRecord
>> in some way that could be dryer and I would like to know if I can
>> submit you a patch to make this override dryer.
>>      
>
> I'm not sure about ActionModel, but we've been working on
> modifications to ActiveRecord validations over on the Rails I18n list
> and any code regarding messages is likely going to change in 3.0.
> You're welcome to come over and discuss your concerns though.
>    

I'm already subscribed to i18n list but I haven't seen any topic about 
3.0 recently.

Are there any repositories where I could take a look at the changes to 3.0?

Anyway, the patch I intend to prepare for submission is not directly 
related to I18n in my opinion.

Please, see my comments on subject at:

https://rails.lighthouseapp.com/projects/8994/tickets/1687-flexible-formatting-for-ar-validation-error-messages#ticket-1687-36

>> Then, I'd like to know better how Rails initialization works. I have
>> noticed that validations.rb is required by activerecord using
>> autoload, while searching the source code. I guess activerecord is
>> also lazy loaded in Rails, but I didn't find any 'autoload' doing this
>> explicitly. I guess activerecord is loaded as a gem, but I didn't find
>> where this lazy loading occurs in gems_dependency.rb, if that is the
>> place where it happens. Where is lazy loading happing on gems?
>>      
>
> Initialization is done in Rails::Initializer, and the frameworks (like
> ActiveRecord) are loaded by Initializer#require_frameworks. The actual
> frameworks that are loaded is configurable in environment.rb. So
> ActiveRecord is explicitely required, but all its various components
> are autoloaded.
>
>    
>> And just out of curiosity, what is reloaded in development mode and
>> how does it occur? Where is the code that does the reloading process?
>>      
>
> Loading and reloading is handled by ActiveSupport::Dependencies, which
> hooks into const_missing for all classes and modules. When
> cache_classes is set to false, everything that is autoloaded is
> unloaded at the end of each request by the Dispatcher. The exception
> is any file that is found in the load_once_paths, which generally
> contains the lib folder for all plugins. The load_once_paths, as well
> as the load_paths, are configurable in environment.rb.
>
> To be honest, once you know where to look, it's relatively easy to
> figure out, as the code is pretty well commented. The trick is to know
> where to look, and this is where a high level overview would be helpful.
>    

Exactly! That is why I am asking for high level overview documentation 
alongside with Rails source code inside the repository.

Thank you very much for you explanations. I'll take a further look at 
source-code to get more details. I think it will be easier now.

Thank you,

Rodrigo.

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