SammyLin / redactor-rails

This repo is deprecated. Please check out official gem for Redactor 2. https://github.com/Redactor2/redactor2_rails
MIT License
389 stars 253 forks source link

Devise fails when using untraditional Devise User class #48

Closed snooc closed 11 years ago

snooc commented 11 years ago

The filters and helpers are hard coded to use the User model. If you are using a model class anything else, the filters will fail.

Example:

# User.rb
authenticate_user!
current_user

# AdminUser.rb 
authenticate_admin_user!
current_admin_user

I have updated my own fork to allow this to be configurable:

https://github.com/snooc/redactor-rails/tree/configurable_devise

Instructions are at the bottom of the README.

Due to the lack of configuration classes in this gem, is opted to just use monkey patching in a initializer to define the class.

I'd love to submit a pull request. :smile: