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

2013-06-27 Thread Amitav Mohanty
Hey On Wed, Jun 26, 2013 at 10:04 PM, Piotr Sarnacki dro...@gmail.com wrote: While technically you could say that false is present, it would be really unintuitive for most of the people as present? is supposed to be just opposite of blank? and is used to check for truthiness. Additionally

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

2013-06-27 Thread Carlos Antonio da Silva
As you can see here: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/blank.rb#L55, blank? is also implemented in FalseClass to always return true, so yes, it was deliberate :) On Thu, Jun 27, 2013 at 8:17 AM, Amitav Mohanty

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

2013-06-26 Thread Piotr Sarnacki
While technically you could say that false is present, it would be really unintuitive for most of the people as present? is supposed to be just opposite of blank? and is used to check for truthiness. Additionally present? is used in Rails app for a long time, so even if part of Rails Core had

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

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