Behavior of mash.foo? #4

Closed
mcmire opened this Issue May 14, 2010 · 2 comments

Comments

Projects
None yet
2 participants

mcmire commented May 14, 2010

Not sure if this is the recommended place to leave issues as no one's left any, but I'll try anyway...

I noticed that saying mash.foo? only checks to see whether foo exists in mash. I'm using Mash to wrap query results (array of hashes) and it would be more intuitive in my case for mash.foo? to also check if foo is a truthy value like ActiveRecord does (technically, return value.present?). I wonder if you guys think this would be useful too. I realize this would break people's code if they aren't expecting this behavior, but I figure I'd ask anyway.

Owner

mbleigh commented Aug 10, 2010

Query methods now return false if the key has been set to nil or false. Closed by 5a53de5

mcmire commented Aug 10, 2010

Awesome, thanks! I'll give that a try.

This issue was closed.

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