This repository was archived by the owner on Jan 30, 2024. It is now read-only.
support mongoid aswell#77
Open
sbounmy wants to merge 1 commit into
Open
Conversation
csroberson
approved these changes
Nov 3, 2018
csroberson
left a comment
There was a problem hiding this comment.
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) | |||
| end | ||
| end | ||
|
|
||
| orm = defined?(Mongoid) ? 'mongoid' : 'active_record' |
| 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.
I like this approach to addressing the issue with OldPassword and Mongoid.
|
|
||
| belongs_to :password_archivable, :polymorphic => true | ||
| attr_accessible :encrypted_password | ||
| end No newline at end of file |
There was a problem hiding this comment.
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.