[Rails-core] How should ActiveSupport::Cache handle nil cache key?

2013-06-25 Thread Huiming Teo
Hi, I notice ActiveSupport::Cache implementations behave differently when cache key is nil. cache_key = nil Rails.cache.write(cache_key, 'value') Rails.cache.read(cache_key) For example, FileStore raises a file system error No such file or directory when calling write() with nil cache key.

Re: [Rails-core] How should ActiveSupport::Cache handle nil cache key?

2013-06-25 Thread T.J. Schuck
From the table in your pull request, the MemCacheStore seems to be the one I'd expect from all the options, i.e. writing or reading a nil key raises ArgumentError: key cannot be blank. Considering the docs even go as far as to say MemCacheStore is currently the most popular cache store for

[Rails-core] Re: false.present? is false. Is it desired behaviour?

2013-06-25 Thread James Pinto
I understand where you're coming from, and I completely disagree false is blank, but it's not nil, however, in some cases, falseness should not be validated validates_presence_of :aggrees_with_contract* is correct, requires the user to check the contract* validates_presence_of

Re: [Rails-core] How should ActiveSupport::Cache handle nil cache key?

2013-06-25 Thread Teo Hui Ming
Should we enforce the no blank key behavior in each implementation, or enforce it in the base class i.e. ActiveSupport::Cache? On Tue, Jun 25, 2013 at 10:24 PM, T.J. Schuck t...@getharvest.com wrote: From the table in your pull request, the MemCacheStore seems to be the one I'd expect from all

Re: [Rails-core] Re: false.present? is false. Is it desired behaviour?

2013-06-25 Thread Amitav Mohanty
Hey On Tue, Jun 25, 2013 at 8:06 PM, James Pinto tap...@gmail.com wrote: I understand where you're coming from, and I completely disagree false is blank, but it's not nil, Well I think since it is a value, it should not be considered blank. however, in some cases, falseness should not

[Rails-core] Casting gem usage in Rails 4/Ruby 2 vs. Rails 4 push for concern usage/Rails delegation

2013-06-25 Thread Gary Weaver
Just read about the Casting gem: https://discuss.gemnasium.com/t/casting-adding-behavior-to-objects-without-using-extend/34 https://github.com/saturnflyer/casting What are the Rails core team's opinions about using Casting vs. ActiveSupport::Concern usage, Rails delegation, etc.? -- You

Re: [Rails-core] Re: false.present? is false. Is it desired behaviour?

2013-06-25 Thread Matt Jones
On Jun 25, 2013, at 7:36 AM, James Pinto wrote: I understand where you're coming from, and I completely disagree false is blank, but it's not nil, however, in some cases, falseness should not be validated validates_presence_of :aggrees_with_contract is correct, requires the user to

Re: [Rails-core] Casting gem usage in Rails 4/Ruby 2 vs. Rails 4 push for concern usage/Rails delegation

2013-06-25 Thread Matt Jones
On Jun 25, 2013, at 9:54 AM, Gary Weaver wrote: Just read about the Casting gem: https://discuss.gemnasium.com/t/casting-adding-behavior-to-objects-without-using-extend/34 https://github.com/saturnflyer/casting What are the Rails core team's opinions about using Casting vs.