Adapt gem to Rails 4