Rails4

wrap the conditions in a proc or lambda which are preferred syntax in Rails 4