-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix migrations #1716
Fix migrations #1716
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1716 +/- ##
==========================================
- Coverage 76.31% 76.30% -0.02%
==========================================
Files 603 603
Lines 46101 46101
Branches 844 844
==========================================
- Hits 35184 35176 -8
- Misses 10821 10828 +7
- Partials 96 97 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
|
||
def self.run | ||
if BASE # Only remove the trigger group microservice if we're not enterprise | ||
MicroserviceModel.get_all_models(scope: 'DEFAULT').each do |microservice_name, microservice_model| |
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.
Don't we need to loop through all the scopes like in no_critical_cmd
?
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.
Base only has DEFAULT scope
@@ -74,13 +74,13 @@ def self.all(scope: nil) | |||
super(PRIMARY_KEY) | |||
end | |||
|
|||
def self.from_json(json) | |||
def self.from_json(json, scope: nil) |
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.
scope is unused ... why is this necessary?
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.
It matches the syntax for the base class. Otherwise more of the default methods have to be overriden.
json = JSON.parse(json, :allow_nan => true, :create_additions => true) if String === json | ||
raise "json data is nil" if json.nil? | ||
self.new(**json.transform_keys(&:to_sym)) | ||
end | ||
|
||
def self.get_model(name:) | ||
def self.get_model(name:, scope: nil) |
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.
scope is unused ... why is this necessary?
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.
It matches the syntax for the base class. Otherwise more of the default methods have to be overriden.
In particular this broke get_all_models
No description provided.