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
[354] Make animals.sex an enum #371
[354] Make animals.sex an enum #371
Conversation
* master: use helper method Add controller spec, redefine UsersController#admin? typo use concern instead of standalone logic Remove unused UntaggedAnimalAssessment model and related code Add organization to tanks and fix related specs Set up UsersController#show, include related test examples Add organization for families Add organizations to families Add organization association to animal
* master: Remove pedigree model and related code
app/views/animals/show.html.erb
Outdated
@@ -32,7 +32,7 @@ | |||
|
|||
<p> | |||
<strong>Sex:</strong> | |||
<%= @animal.sex %> | |||
<%= @animal.sex&.humanize %> |
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.
Is there ever a scenario where there is no sex?
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.
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.
Actually yes! In our meeting with stakeholders yesterday, and in the data files they have sent us, there are many cases where the sex of an animal is unknown or not able to be determined until the animal is more mature.
My preference would be to make the column non-nullable in the database and add a third "unknown" option to the enum.
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.
implemented here @haydenrou @benreyn 8631e19
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.
Awesome! Thanks @viniciusgama !
* master: Remove post settlement inventory model and related code using current_organization method to get users added show link in index view setting up index view for users and adding specs
Checklist:
Resolves #354
Description
This also make sure that when inputing the data in the form, the user can only select valid options.
List any dependencies that are required for this change. (gems, js libraries, etc.)
activerecord-postgres_enum
I have chosen this option as it's the one with the most recent releases which indicates it's being actively being developed
Type of change
How Has This Been Tested?
Screenshots