Rails4

wrap the conditions in a proc or lambda which are preferred syntax in Rails 4
Avoid using {...} for multi-line blocks.<br>Block body expression is on the same line as the block start.