-
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
Rosters #43
Merged
Rosters #43
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
76d5b96
Update seed file and Gemfile, and write rotation model
dfaulken d24b339
Merge branch 'master' of github.com:umts/screaming-dinosaur into rota…
dfaulken 5bb0716
Add needed columns
dfaulken 533e9a8
Passing specs
dfaulken 2b43bad
Developer login and index work
dfaulken a49faab
Rotation edit page works
dfaulken 6a03af1
Fixed overlap validation
dfaulken acee8bb
User edit works
dfaulken 74bad9c
Remove fallback validation from user
dfaulken 759daf3
New user works
dfaulken b8ddc2f
Basic rotations index
dfaulken f172150
Rotations edit works
dfaulken 44a96c1
Initial login logic
dfaulken 5d76162
Show links for each rotation a person is in
dfaulken 9d0bc49
Just display calendar for people in only one rotation
dfaulken 0d67bc6
Adding users to multiple rotations
dfaulken 4e95b50
Generating rotations works
dfaulken 24a2a57
Remove old method
dfaulken 71c15c1
Twilio actions are scoped per-rotation
dfaulken 43acf34
No special user validations anymore
dfaulken 4250a08
Remove tests for disused model method
dfaulken 1226cf3
Move specs from Assignment to Rotation
dfaulken f09b62c
Fix final failing assignment model test
dfaulken 8bed699
Complete assignment model tests
dfaulken 78571c1
Make sure Assignment#current is scoped to the target assignments' rot…
dfaulken 79e0595
Finish porting the previous rotation generation specs
dfaulken 41e3183
Finish rotation model specs
dfaulken c14aa68
Test SessionsController
dfaulken bf14c3f
Test Twilio controller
dfaulken 4e0a564
Current coverage
dfaulken 2fe4d2b
Fill out the remaining Rotation CRUD routes
dfaulken ce506b4
Fix reference to disused model method
dfaulken ccd0e4f
Link to manage rotations
dfaulken 2799f8d
Validate for rotation presence
dfaulken 4fa0e3a
Reorganize 'navbar'
dfaulken 1129106
Fix making new assignments and validation
dfaulken 2dbbf08
Extract links into a partial
dfaulken 8ef75d7
Some links CSS, and show current rotation more obviously
dfaulken a9cd43b
The end of the styling tweaks
dfaulken 95968d0
use correct path
Anbranin e40a8ec
fix tests
Anbranin 852a130
change factories to reflect correct attributes
Anbranin 883275f
find rotation before every controller action
Anbranin 622fbbc
called already before all controller actions
Anbranin 9a027e2
do not override application controller method
Anbranin 39a8e03
called already before all controller actions
Anbranin 610d15a
fixed specs
Anbranin 383a843
change spec to be passing
Anbranin f2ea6df
started new spec file
Anbranin dd46bf2
rename rotation to roster
Anbranin ea9975f
testing rosters
Anbranin 23f7b86
bring test coverage up to 100
Anbranin 4684d59
write method to create user with specific roster
Anbranin 2280b51
rubocop failures
Anbranin f0603cf
rubocop tweaking
Anbranin 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 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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
require: umts-custom-cops | ||
inherit_from: .rubocop-no-umts-cops.yml | ||
|
||
HasAndBelongsToMany: | ||
Enabled: false |
This file contains 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 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 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,28 @@ | ||
#links{ | ||
background: #881c1c; | ||
color: white; | ||
float: right; | ||
font-size: 18px; | ||
padding: 0.5em 1em; | ||
.group{ | ||
padding: 5px 0; | ||
&.session{ | ||
padding-bottom: 20px; | ||
#logout{ | ||
float: right; | ||
margin-right: 2em; | ||
text-align: right; | ||
} | ||
} | ||
a{ | ||
color: #ddd; | ||
padding-right: 1em; | ||
&.current{ | ||
background: #d94545; | ||
border-radius: 6px; | ||
color: white; | ||
padding: 5px 10px; | ||
} | ||
} | ||
} | ||
} |
This file contains 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 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 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,49 @@ | ||
class RostersController < ApplicationController | ||
before_action :find_roster, only: [:destroy, :edit, :update] | ||
|
||
def create | ||
roster_params = params.require(:roster).permit(:name) | ||
roster = Roster.new roster_params | ||
if roster.save | ||
flash[:message] = 'Roster has been created.' | ||
redirect_to rosters_path | ||
else | ||
flash[:errors] = roster.errors.full_messages | ||
redirect_to :back | ||
end | ||
end | ||
|
||
def destroy | ||
@roster.destroy | ||
flash[:message] = 'Roster and any assignments have been deleted.' | ||
redirect_to rosters_path | ||
end | ||
|
||
def edit | ||
@users = @roster.users | ||
end | ||
|
||
def index | ||
@rosters = Roster.all | ||
end | ||
|
||
def new | ||
end | ||
|
||
def update | ||
roster_params = params.require(:roster).permit! | ||
if @roster.update roster_params | ||
flash[:message] = 'Roster has been updated.' | ||
redirect_to rosters_path | ||
else | ||
flash[:errors] = @roster.errors.full_messages | ||
redirect_to :back | ||
end | ||
end | ||
|
||
private | ||
|
||
def find_roster | ||
@roster = Roster.find(params.require :id) | ||
end | ||
end |
This file contains 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 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 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 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
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.
Personally, I like to add comments explaining why we're disagreeing with Rubocop.