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

Bendyworks/deduplicate starting salary #267

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

rogerroelofs
Copy link

Salaries are moved to relate to tenures and a new salary record is created on hire with a start date matching the first tenure. There are no data entry changes related to this but there may be a few more interstitial data points in the salary charts because of the new salary records.

@@ -12,8 +12,10 @@ def new
def edit; end

def create
@employee = Employee.new(employee_params)
salary_params = employee_params.dig(:salaries_attributes, "0")
Copy link
Author

Choose a reason for hiding this comment

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

I don't love this but I was having trouble making the employee model validate on create.

Choose a reason for hiding this comment

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

I wonder if this validation could be handled in a before_action method?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could adding :inverse_of to the salary model fix this?

rails/rails#8828

@aterrype
Copy link
Contributor

If you change the start date, the starting salary date doesn't change with it, and can end up before the start date.

@rogerroelofs
Copy link
Author

@aterrype You are so right. Thanks for pointing that out. It should be fixed now.

@aterrype
Copy link
Contributor

I'm still seeing some odd behavior around changing the start date:
-You can change the start date to be after the raise date, though that might be a preexisting bug.
-If you try to change the start date back to the original date after doing that, you then get an error about salary start dates not being after the start date:
image
image

@Code47X
Copy link
Contributor

Code47X commented Mar 26, 2021

I'm merging in the rails bump on main now. Pull that in so our CI/CD pipeline is fixed

Copy link

@Chazz-Michaels Chazz-Michaels left a comment

Choose a reason for hiding this comment

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

Aside from the comment that Amy left here, this looks good to me 👍

@rogerroelofs
Copy link
Author

@aterrype Thanks for testing. The UI has changed so I don't think the error you were seeing is happening any more.

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

4 participants