-
Notifications
You must be signed in to change notification settings - Fork 346
support mongoid aswell #77
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell, this would be a reasonable addition to address the Mongo issue. I will be trying this on my local system.
@@ -1,5 +1,5 @@ | |||
#require 'rails/all' | |||
require 'active_record/connection_adapters/abstract/schema_definitions' | |||
require 'active_record/connection_adapters/abstract/schema_definitions' if defined?(ActiveRecord) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -80,6 +80,8 @@ module Controllers | |||
end | |||
end | |||
|
|||
orm = defined?(Mongoid) ? 'mongoid' : 'active_record' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
require 'devise_security_extension/models/old_password' | ||
require 'devise_security_extension/models/security_question' | ||
require 'devise_security_extension/orm/active_record' if defined?(ActiveRecord) | ||
require "devise_security_extension/models/#{orm}/old_password" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach to addressing the issue with OldPassword and Mongoid.
|
||
belongs_to :password_archivable, :polymorphic => true | ||
attr_accessible :encrypted_password | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment on this model (and I'm not a Ruby on Rails expert, so take it with a grain of salt but) wouldn't defining belongs_to :password_archivable, :polymorphic
automatically created the password_archivable_id
and password_archivable_type
fields?
No description provided.