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

Restore note about custom db class in README #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marvinthepa
Copy link
Contributor

I am not sure if this is correct, but it seems to me that the rake task does not work if users are using a custom class (especially if the table name is different).

My suggestion is to restore the old note.

ghiculescu added a commit to ghiculescu/activerecord-session_store that referenced this pull request Mar 10, 2021
@ghiculescu
Copy link
Member

alternatively, #179

@marvinthepa
Copy link
Contributor Author

alternatively, #179

@ghiculescu I think this is something different. This part of the README references the db:sessions:upgrade task, #179 is about trim.

@ghiculescu
Copy link
Member

Ooops I misread your changes, sorry!

@ghiculescu
Copy link
Member

It does seem to me like the sessions upgrade task respects custom classes though? https://github.com/rails/activerecord-session_store/blob/master/lib/tasks/database.rake#L24

@marvinthepa
Copy link
Contributor Author

marvinthepa commented Mar 10, 2021

It does seem to me like the sessions upgrade task respects custom classes though?

It tries to use the custom class. But it will not work if the custom class does not have a secure! method. Maybe instead of this, it should be mentioned in the README that the custom class needs to copy the secure! method from ActiveRecord::SessionStore::Session.
I do not know, I just wanted to start a discussion on how to correctly point the users in the right direction.

ghiculescu added a commit to ghiculescu/activerecord-session_store that referenced this pull request Mar 10, 2021
ghiculescu added a commit to ghiculescu/activerecord-session_store that referenced this pull request Mar 10, 2021
@ghiculescu
Copy link
Member

Maybe instead of this, it should be mentioned in the README that the custom class needs to copy the secure! method from ActiveRecord::SessionStore::Session.

I like this idea. Have implemented in #179 as part of the other stuff I'm doing, and added you as a co-author.

ghiculescu added a commit to ghiculescu/activerecord-session_store that referenced this pull request Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants