So `config.for.redis.host` vs. `config_for(:redis)['host']`.

Number 2 is a clear winner for me. Much cleaner, does not require 
metaprogramming to be implemented (method_missing or define_method) and is 
much simpler in the implementation.

On Wednesday, 17 September 2014 05:08:30 UTC+3, Gabriel Sobrinho wrote:
>
> Hello guys,
>
> I just came across this post 
> http://www.justinweiss.com/blog/2014/08/25/the-lesser-known-features-in-rails-4-dot-2/?utm_source=rubyweekly&utm_medium=email
>  
> which shows the Rails.application.config_for feature.
>
> What if config.x by default reads the configuration files?
>
> In other words, Rails.config.x.redis.host == 
> Rails.application.config_for(:redis)["host"].
>
> -- 
> Cheers,
>
> Gabriel Sobrinho
> http://gabrielsobrinho.com/
>  

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to