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

Remove usages of ::User from ApplicationController #15804

Conversation

rafatower
Copy link
Contributor

@rafatower rafatower commented Sep 2, 2020

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

@rafatower rafatower force-pushed the feature/ch101632/remove-usages-of-user-from-applicationcontroller branch from a96d50d to e03e2e0 Compare September 7, 2020 10:45
@@ -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
Copy link
Contributor Author

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.
@rafatower rafatower changed the title Retrieval of current_viewer using AR Carto::User Remove usages of ::User from ApplicationController Sep 7, 2020
@rafatower rafatower marked this pull request as ready for review September 7, 2020 14:15
@@ -0,0 +1,13 @@
module Carto::Sessions
Copy link
Contributor

@thedae thedae Sep 7, 2020

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.
Copy link
Contributor

@thedae thedae left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@amiedes amiedes left a comment

Choose a reason for hiding this comment

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

Awesome 🚀

@rafatower rafatower merged commit 23db2bb into master Sep 8, 2020
@rafatower rafatower deleted the feature/ch101632/remove-usages-of-user-from-applicationcontroller branch September 8, 2020 08:31
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.

None yet

3 participants