-
Notifications
You must be signed in to change notification settings - Fork 2
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
2466: STI-ify PayrollAccounts #473
base: main
Are you sure you want to change the base?
Conversation
def self.sti_name | ||
# "PayrollAccount::Pinwheel" => "pinwheel" | ||
name.demodulize.downcase | ||
end | ||
|
||
def self.sti_class_for(type_name) | ||
# "pinwheel" => PayrollAccount::Pinwheel | ||
PayrollAccount.const_get(type_name.capitalize) | ||
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.
Not sure this is necessary? Since the behavior is default
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.
I guess we can try removing it? It probably is not necessary if we are ok with the "type" column having "payroll_account/pinwheel" as the value rather than just "pinwheel".
# Conflicts: # app/app/models/payroll_account.rb # app/db/schema.rb # docs/app/rendered/database-schema.pdf
43d259c
to
f8de0ab
Compare
def self.sti_name | ||
# "PayrollAccount::Pinwheel" => "pinwheel" | ||
name.demodulize.downcase | ||
end | ||
|
||
def self.sti_class_for(type_name) | ||
# "pinwheel" => PayrollAccount::Pinwheel | ||
PayrollAccount.const_get(type_name.capitalize) | ||
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.
I guess we can try removing it? It probably is not necessary if we are ok with the "type" column having "payroll_account/pinwheel" as the value rather than just "pinwheel".
Ticket
Resolves FFS-2466.
Changes
Convert PayrollAccounts to an STI with a Pinwheel subclass.
Context for reviewers
Acceptance testing
:alert: Deploy block! @ffs-eng I just merged PR [#123] and will be doing acceptance testing in demo - please don't deploy until I'm finished!
)