Ruby/rails boolean
A few things to think about --
Do people rely on database fields always being nil or do you initialize new objects to something else?
I find myself using the isblank? method (added to rails but is not present in ruby) to test for boolean a lot in my code. Do others make extensive use of this?
Is it a good working assumption to design around the idea that ruby/rails most always returns nil as the result of a method call resulting in nothing? (Obviously taking note of what actually occurs but starting from that general idea)
What other philosphies, tricks ideas do folks employ regarding booleans in ruby/rails?
My holy grail is a simple/clear/short best practices for boolean in ruby/rails. My current cheat sheet is more of a manifesto than a ten commandments.
0 comments
[ 4.1 ms ] story [ 12.6 ms ] threadNo comments yet.