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

Lynn & Chantal's Video Store #6

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b435367
added routes and created api
May 9, 2017
7f890ac
Generated Models and controllers, tested zomg
ltrickey May 9, 2017
5e35441
Able to run seeds
ltrickey May 9, 2017
f3c1a31
Created initial movie model tests
ltrickey May 9, 2017
1b0954b
Created Join Table for Movie/Customer
ltrickey May 9, 2017
b322dae
fixed test for customer relationship, added test for movie relationship
May 9, 2017
e940c8e
Added initial controller testing for customers controller index and show
ltrickey May 9, 2017
d43b5f6
Finished testing for customers controller
ltrickey May 9, 2017
c1d3841
added movie controller tests, all passing
May 9, 2017
8c8760e
fixed what index showed about the movie, adjusted test
May 9, 2017
eb19c49
Added rental model and initial testing
ltrickey May 9, 2017
d017f12
Dropped join table. Did not break things. Hopefully
ltrickey May 9, 2017
0bc8bba
added rental controller, and pseudo coded methods
May 9, 2017
12a30e2
added some test outlines for the rentals controller
May 9, 2017
d0269c3
added some tests and pseudo method code for rentals controller
May 10, 2017
4ad2065
added check out method, need to finish tests
May 10, 2017
18b91ad
finished tests for checkout, filled out method, need to work on overdue
May 10, 2017
5781704
Added new route for checkin
ltrickey May 10, 2017
946b51a
initial tests passing. Refactored if statements in checkin method
ltrickey May 10, 2017
4eb03d1
finished testing for checkin rentals controller
ltrickey May 10, 2017
ba36346
Updated MOVIE KEYS constant in movies controller test
ltrickey May 10, 2017
dab1d62
added overdue test, not passing yet
May 10, 2017
a635bee
fixed merge conflicts
May 10, 2017
b4c349f
Added a line to add available inventory into our seeds
ltrickey May 10, 2017
b884256
Merge branch 'lt/seeds'
ltrickey May 10, 2017
c854775
Added simplecov
ltrickey May 10, 2017
4a2ada2
Added status code for index in movies controller 200 OK, and errors t…
ltrickey May 10, 2017
9928a45
Updated tests for checking for errors
ltrickey May 10, 2017
b8ede1b
Updated test again
ltrickey May 10, 2017
4a4bad8
updated our tests to reflect the error message requirements
ltrickey May 10, 2017
df29157
Added initial test and method for Rental.overdue class method
ltrickey May 11, 2017
bb4993b
finished testing of overdue model method
ltrickey May 11, 2017
e3d6376
adding overdue in rentals controller WIP
ltrickey May 11, 2017
c92b846
added json render section to overdue method in rentals controller, ne…
May 11, 2017
9ee02bd
added tests for overdue info hash, need to fix another test because o…
May 12, 2017
8d6677a
Added timezone to due date
ltrickey May 12, 2017
be933f9
fixed rental test that wasn't passing
ltrickey May 12, 2017
ab8a55a
Added route for overdo
ltrickey May 12, 2017
db72827
Finished rental controller testing. Also adjusted what was being ret…
ltrickey May 12, 2017
5561284
Fixed rental controller to handle if customer id is not in database a…
ltrickey May 12, 2017
716a867
got to 100 percent coverage
ltrickey May 12, 2017
4ea1b10
added code and test to make sure rentals can only be checked in once
ltrickey May 12, 2017
93c24bd
added & fixed some testing
ltrickey May 12, 2017
49e6d54
pulled out find_movie into a private method
ltrickey May 12, 2017
a65b886
cleaning up rentalls controller and tests
ltrickey May 12, 2017
f47f863
added sort by name feature to customers controller, need to test
May 12, 2017
ae7de59
added test for sorting feature
May 12, 2017
30ef637
adding coverage files
ltrickey May 12, 2017
7c92200
Fixing silly merge conflicts in coverage file
ltrickey May 12, 2017
4ae6543
Changed smoke test and got most of them passing
ltrickey May 12, 2017
25b4dcb
Added migration for movies_checked_out_count
ltrickey May 12, 2017
1322932
added movies_checked_out_count method and controller test to rentals …
ltrickey May 12, 2017
6448a62
modified check in method to accomodate new movie count feature, all t…
May 12, 2017
1716978
Added one final test
ltrickey May 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding overdue in rentals controller WIP
ltrickey committed May 11, 2017
commit e3d63764edc9751f0d7c6dbf580ffe11120e8679
9 changes: 6 additions & 3 deletions app/controllers/rentals_controller.rb
Original file line number Diff line number Diff line change
@@ -58,9 +58,12 @@ def checkin

def overdue
# if due date is 31 days ago
if rental.due_date.past?
# change status to "overdue"
rental.status = "overdue"
overdues = Rental.overdue

if overdues == []
render status: :not_found, json: {errors: {rentals: ["No Overdue Rentals" ]}}
else
render json: overdues.as_json(only: [:title, :release_date]), status: :ok
end
end