I agree with Godfrey. This is perhaps more of a semantic issue (A blank
object is still present) and you are better off simply doing a quick nil?
check.


On Thu, May 30, 2013 at 11:33 PM, Godfrey Chan <[email protected]> wrote:

> Regardless of the merit (I don't have a strong opinion on what is
> "correct" here), it's 100% too big of a breaking change and it's gonna
> break a lot of people's app in some subtle but potentially very dangerous
> ways.
>
> -100 for me
> —
> Sent from Mailbox <https://www.dropbox.com/mailbox> for iPhone
>
>
> On Thu, May 30, 2013 at 2:33 PM, Amitav Mohanty <[email protected]
> > wrote:
>
>> Hey
>>
>> I initially posted this idea on Github where I was suggested by Steve to
>> post it here. The idea is as follows.
>>
>> With the current definition of blank? as defined in
>> https://github.com/rails/rails/blob/2a371368c91789a4d689d6a84eb20b238c37678a/activesupport/lib/active_support/core_ext/object/blank.rb#L16false.present?
>>  returns false. The documentation mentions it clearly too.
>> However, I was of the opinion that a value of false is still a value and
>> there probably should return true when checked for presence.
>>
>> When an array is empty, it does not contain any valid values and thus is
>> blank. However, false is a valid value for a boolean variable. So, probably
>> false.present? should not be false.
>>
>> This is of course just my opinion. I know I can always check for nil?. If
>> there are valid scenarios where false.present? returning a value of false
>> is useful/intuitive, I would be glad to know.
>>
>> I have explained at
>> http://intosimple.blogspot.in/2013/05/rails-falsepresent-being-false-is-not.html
>>  one scenario where I thought false.present? returning true would have
>> been more intuitive. Please have a look and let me know your ideas.
>>
>> Thanks and regards,
>> Amitav
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to