activerecord-session_store icon indicating copy to clipboard operation
activerecord-session_store copied to clipboard

Restore note about custom db class in README

Open marvinthepa opened this issue 3 years ago • 6 comments

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.

marvinthepa avatar Mar 10 '21 15:03 marvinthepa

alternatively, https://github.com/rails/activerecord-session_store/pull/179

ghiculescu avatar Mar 10 '21 16:03 ghiculescu

alternatively, #179

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

marvinthepa avatar Mar 10 '21 18:03 marvinthepa

Ooops I misread your changes, sorry!

ghiculescu avatar Mar 10 '21 18:03 ghiculescu

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

ghiculescu avatar Mar 10 '21 18:03 ghiculescu

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.

marvinthepa avatar Mar 10 '21 18:03 marvinthepa

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 https://github.com/rails/activerecord-session_store/pull/179 as part of the other stuff I'm doing, and added you as a co-author.

ghiculescu avatar Mar 10 '21 19:03 ghiculescu