Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Conversation

@sbounmy
Copy link

@sbounmy sbounmy commented Feb 14, 2014

No description provided.

Copy link

@csroberson csroberson left a 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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

end
end

orm = defined?(Mongoid) ? 'mongoid' : 'active_record'

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"

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 No newline at end of file
Copy link

@csroberson csroberson Nov 3, 2018

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants