diff --git a/lib/redactor-rails.rb b/lib/redactor-rails.rb index 9f7c5931..b6fc232d 100644 --- a/lib/redactor-rails.rb +++ b/lib/redactor-rails.rb @@ -38,4 +38,8 @@ def self.devise_user def self.devise_user_key "#{self.devise_user.to_s}_id".to_sym end + + def self.devise_user_class_name + "User" + end end diff --git a/lib/redactor-rails/orm/active_record.rb b/lib/redactor-rails/orm/active_record.rb index 3ab7ef08..0cce209f 100644 --- a/lib/redactor-rails/orm/active_record.rb +++ b/lib/redactor-rails/orm/active_record.rb @@ -15,7 +15,7 @@ def self.extended(base) self.table_name = "redactor_assets" belongs_to :assetable, :polymorphic => true - belongs_to RedactorRails.devise_user, :foreign_key => RedactorRails.devise_user_key + belongs_to RedactorRails.devise_user, :foreign_key => RedactorRails.devise_user_key, :class_name => RedactorRails.devise_user_class_name if defined?(ActiveModel::ForbiddenAttributesProtection) && base.ancestors.include?(ActiveModel::ForbiddenAttributesProtection) # Ok