Use lambda for scope in order to be compatible with rails 4

This will break compatiblity with ruby 1.8 and previous versions of rails so it might not be a good idea to merge in master :)