-
Notifications
You must be signed in to change notification settings - Fork 655
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
Remove usages of ::User from ApplicationController #15804
Remove usages of ::User from ApplicationController #15804
Conversation
a96d50d
to
e03e2e0
Compare
and move the compatibility code to ActiveRecordCompatibility module.
@@ -99,11 +100,6 @@ def static_notifications_with_creation | |||
end | |||
alias_method_chain :static_notifications, :creation | |||
|
|||
def invalidate_all_sessions! | |||
user = ::User.where(id: self.id).first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#murico: Carto::User
dependency upon ::User
This shouldn't matter at Cartodb <-> Central JSON communication API level, but keeping the behavior anyways.
app/models/carto/helpers/sessions.rb
Outdated
@@ -0,0 +1,13 @@ | |||
module Carto::Sessions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, this helper looks like a future "misc" file with tons of code related to sessions.
Since the only responsability of this module is to invalidate sessions, what if we change the purpose and rename it?
I loved the ActiveRecordCompatibility module: it's simple, small and clear
for the sake of specificity, as per review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 🚀
See https://app.clubhouse.io/cartoteam/story/101632/remove-usages-of-user-from-applicationcontroller
Note: in general warden session black magic internally seems to rely exclusively on username and token, and there's a lot of common stuff already moved to
Carto::UserCommons
.Note2: this is built on top of the previous PR #15807