Create logfile, if not exits.
Using ActiveSupport::ProxyObject instead of ActiveSupport::BasicObject for Rails 4
Uses new AR `.all` instead of `.scoped`
Adds references option to support Rails4 implicit table referencing.