add core_ext boolean? #8278

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

jjyr commented Nov 20, 2012

true.boolean? #=> true
false.boolean? #=> true
#Only true or false is boolean.
Object.new.boolean? #=> false
Member

steveklabnik commented Nov 20, 2012

Can you please demonstrate a use-case for this code? ie, in what situation does this method add clarity?

jjyr commented Nov 20, 2012

I have a search form and i need a radiobutton group to condition user(search result) who verified,unverified, or both.I use true,false and nil...

ok i think i can use params.has_key?
just provide more way...

Owner

pixeltrix commented Nov 20, 2012

Thanks for the contribution but Active Support isn't meant to be a general Ruby extensions library, its main purpose is to provide abstractions, utilities, etc. that either support the other frameworks within Rails or ease the development of web applications. Since any use within an app is likely to be limited it's not worth polluting the global method namespace.

pixeltrix closed this Nov 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment