Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/redactor-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/redactor-rails/orm/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down