Everything after the if
must be part of the condition by virtue of the syntax. The only way to get around this is to be really specific:
(@building.approved = params[:approved] if xyz) && abc && ...
Which is obviously not what you're intending here.
Operator binding strength isn't an issue here since if
is a syntax element not an operator, so it has the absolute lowest priority.
The only conditions that will be evaluated are the ones that produce a logically false value, or come after one that was logically true as the first one to return logically false will halt the chain.
That is:
if a && b && c
Will stop at a
if that is a logically-false value. b
and c
will not be evaluated. There's no intrinsic limit on chaining though.