cleanup like_any with some arel

Fixes #3701
Dont set preference on assets:precompile

Avoid opening a db connection when running assets:precompile to help
users to deploy their apps to heroku

Fixes #3703