Closed crdunwel closed 9 years ago
:+1:
Looks good. I'm a big fan of ruby's one line if statements.
if zip4.match(/\d{4}/) and user_profile.zip_four.blank?
user_profile.zip_four = zip4
end
to be condensed into
user_profile.zip_four = zip4 if zip4.match(/\d{4}/) && user_profile.zip_four.blank?
It could help cut down on the bulk. Obviously, it's just me being picky on readability and isn't a big deal at all. In the words of @handlers, there are plenty of other broken things to fix.
Yeah, one of the things I like best about ruby is the flexible in syntax. I like one liners as well and use them a lot. Typically I use them for boolean expressions with only one clause (and more-so with unless than if because that's more natural in english). For expressions with more than one clause, I usually break it into multiple lines so for greater reading clarity. Whether I use "or/and/not" or "||/&&/!" depends a lot on the length of each clause and the types of symbols in them. Typically the more mathy the evaluation, the more likely I will use the C derived symbols. Word methods I use the english.
:shipit:
merge me plz