Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing locked_at field (clash with Devise). #26

Closed
stulentsev opened this issue Aug 25, 2014 · 5 comments
Closed

Allow customizing locked_at field (clash with Devise). #26

stulentsev opened this issue Aug 25, 2014 · 5 comments

Comments

@stulentsev
Copy link

mongoid-locker uses hardcoded field name :locked_at. This is also the name that is hardcoded into Devise::Lockable module.

In our app that led to a nasty bug where users would be spontaneously logged out. Very annoying.

I tried to make the field configurable but I hated the result (code becomes quite uglier). So I won't be posting a PR now, I'm afraid.

In our app I fixed it by forking and hardcode-renaming the field: https://github.com/stulentsev/mongoid-locker/tree/alternate_field

A clash with such popular gem as Devise should be a serious problem. I'm actually surprised it didn't surface earlier.

@dblock
Copy link
Collaborator

dblock commented Aug 25, 2014

I'd like a PR that lets you customize the field. I'll rename the title of this issue to that.

@dblock dblock changed the title Field name clash with Devise. Allow customizing locked_at field (clash with Devise). Aug 25, 2014
@afeld
Copy link
Collaborator

afeld commented Aug 26, 2014

Yeesh, that's unfortunate about the Devise clash. 👍 for making the name configurable, and/or changing the default to something like mongoid_locker_locked_at.

@stulentsev
Copy link
Author

There's the PR with renaming (for now). I'll take another stab on configurability later this week.

@dblock
Copy link
Collaborator

dblock commented Aug 22, 2018

Resolved in #55. Please try HEAD!

@dblock dblock closed this as completed Aug 22, 2018
@stulentsev
Copy link
Author

Awesome news! I felt kinda bad about not following up on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants