-
Notifications
You must be signed in to change notification settings - Fork 650
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
Migrate OauthToken from Sequel to AR #15840
Migrate OauthToken from Sequel to AR #15840
Conversation
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 👍
add_association_dependencies :oauth_tokens => :destroy | ||
def tokens | ||
Carto::OauthToken.where(client_application_id: id) | ||
end |
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.
👏 👏 on cutting those associations.
Probably ClientApplication
should be the next one to target.
@@ -0,0 +1,386 @@ | |||
class UserMetadataExportFactory | |||
|
|||
def self.full_export(params = {}) |
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.
OMG 😄
client_application = carto_user.client_application | ||
|
||
access_token = Carto::AccessToken.create(:user => carto_user, :client_application => client_application) | ||
access_token.present? |
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.
minor thing: I think the test does nothing if it is nil
(it will fail later) unless you write something like expect(access_token.present?).to be true
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.
👍
The oob? method is used from the gem, and the name of the tokens association is also hardcoded there
Story details: https://app.clubhouse.io/cartoteam/story/104097
What does this PR do?
Migrates
::OauthToken
,::AccessToken
and::RequestToken
fromSequel
toActiveRecord
Main issues faced
Check https://app.clubhouse.io/cartoteam/story/104097/migrate-oauthtoken-from-sequel-to-ar#activity-105485