The best name for "x" that I can think of would be "for".

`config.for.redis.host`

Allen Madsen
http://www.allenmadsen.com


On Wed, Sep 17, 2014 at 9:22 AM, Mohamed Wael Khobalatte
<wael.khobala...@gmail.com> wrote:
> config_for is better because it signals that you are doing non-standard
> configuration reading (i.e. you are loading a file, not reading directly
> from the Configuration object). The syntax you are suggesting will require
> we mess with the method_missing behavior to either read from config hash or
> read from a YAML file, depending on "x".
>
> On Wed, Sep 17, 2014 at 2:41 PM, powiii <corestudios...@gmail.com> wrote:
>>
>> I don't think this would be a good idea. IMO doing a
>> `config_for(:redis)['host']` is much more clear than doing a
>> `config.x.redis.host`.
>>
>> By the way what would that "x" be? Can you think of a good name?
>>
>>
>> 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.
>
>
>
>
> --
> Mohamed Wael Khobalatte
>
> --
> 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.

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