This repository was archived by the owner on Dec 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Add military_status to user (fixes #373) #375
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0d4ef35
Add military_status to user
hollomancer beefd4d
Remove extra empty line
hollomancer 2ad6012
add api blueprint
hollomancer ab8d9e2
Fix apiary blueprint entry
hollomancer c0d852e
Add military_status to users_controller and user
hollomancer 046ab05
Update apiary and add constant for MILITARY_STATUSES
hollomancer b00f188
remove trailing whitespace
hollomancer 0310717
Add failing test for the spaghetti monster
hollomancer 701fb25
Add validation and ActiveAdmin entries
hollomancer 990af71
Fix test
hollomancer 37bdb1b
Update rubocop rules
hollomancer e7f3704
Remove duplicate input
hollomancer 49c9c09
Update tests
hollomancer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddMilitarystatusToUser < ActiveRecord::Migration[5.0] | ||
def change | ||
add_column :users, :military_status, :string | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As this is a
string
, is the plan to accept anystring
, or a specific list of strings for consistency? Meaning a specified set of four statuses, for example. I highly recommend the latter.This way, we can enforce data integrity, hang logic on the responses, do data analysis, filtering and searching, add rules for certain statuses, etc., etc.
If the answer is yes, then we'll need to do a few extra additions in this PR before shipping it.
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.
Yeah, I agree. Let's do it the right way.
From the frontend,
current, veteran, spouse
are the values provided.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'd just need to add the check in
/app/models/user.rb
, is that correct?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.
@hollomancer - To establish the specific set of validated statuses, you'll want to:
nil
, to account for our current users, and future users, that will not have a status. For example:models/user.rb
, Add aninclusion
validation for the new:military_status
attribute, for theMILITARY_STATUSES
. Here is how to do that.admin/user.rb
, add the set of selections to ActiveAdmin dashboard form portion. For example:user_test.rb
testing the new inclusion validationmilitary_status
definition, change that to something like: