if !store.url.nil? and store.url != store.new_data.url
OR
if ! store.url.nil? && store.url != store.new_data.url
OR
if (!store.url.nil? && store.url != store.new_data.url)
Main items I’d like to get advice on:
-
Is it better to put a space after the bang?
-
&& -or- and
-
|| -or- or
You must always use “&&” or “||” in an boolean statement.
“and” and “or” should be used for control flow like if or unless.
If you’re working in Rails, you can also do
Do not put spaces after the negation exclamation. Using brackets willy nilly is frowned upon in the general ruby coding conventions, so avoid if you can.