Updated the generated scopes to use a lambda so that they are compatible with Rails 4.