compatible to Rails 4