Remove Rails 3 conditionals
More order to lambda for has_many
Update query.all to query.to_a to get array
Use unscoped/scoping instead of with_exclusive_scope