forked from AdaGold/video-store-api
-
Notifications
You must be signed in to change notification settings - Fork 19
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
bo and sai's video store API #16
Open
ssamant
wants to merge
74
commits into
Ada-C7:master
Choose a base branch
from
ssamant:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,777
−0
Open
Changes from 3 commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
5fe5fd3
made new empty api app
ssamant d01445a
Merge pull request #1 from ssamant/generate_new_api_app
ssamant b5bdffa
baseline with test route
ssamant 8d5c69e
Merge pull request #2 from ssamant/baseline
ssamant 056e985
added gems needed for testing and error views
botrethewey 80e3529
Merge pull request #3 from ssamant/add-gems
botrethewey 33b86fa
generated models for movies and customers
botrethewey a602dea
Merge pull request #4 from ssamant/add-models
botrethewey 2cebec7
updated gemfile.lock
botrethewey 2117324
added coverage to gitignore
ssamant 196cf06
Merge branch 'master' of https://github.com/ssamant/VideoStoreAPI
ssamant 3886f7d
Merge branch 'master' of https://github.com/ssamant/VideoStoreAPI
botrethewey 5a031f2
schema created
botrethewey 23a3ada
schema file
ssamant bee7a24
Merge branch 'master' of https://github.com/ssamant/VideoStoreAPI
ssamant 732afca
added default value for account credit in Customer model
ssamant cb26563
validations for customer and movie models
ssamant 8abd0ab
Merge pull request #5 from ssamant/modify_models
ssamant fb97a18
trying to fix regex in customer model
ssamant 7ca8c02
adjusting regex
ssamant 91ccd40
tests for customer model
ssamant a4a0e95
tests for Movie model
ssamant c40ab78
Merge pull request #6 from ssamant/model_tests
ssamant 563e704
initially generted controllers for customers and movies
botrethewey 638714c
update routes
botrethewey 7be22ef
added controller tests for customers
botrethewey de6fe7a
update customers controller
botrethewey 8ef5f20
Merge pull request #7 from ssamant/add-controllers
botrethewey 121b2c1
movie controller tests and controller index and show actions
ssamant df86273
test for custom method available_inventory and method
ssamant ff507d5
Merge pull request #8 from ssamant/movie_controller_testing
ssamant 7847e96
update error handling for movie show action
botrethewey 221d35e
Merge pull request #9 from ssamant/update-error-handling
botrethewey 2d37a9e
wip: added custom method to customer model
botrethewey 0785c12
Merge pull request #10 from ssamant/add-custom-method-to-customer
botrethewey 4cebdb2
finishing test and controller action for movie count
ssamant fa4b7cd
Merge pull request #11 from ssamant/customer_movie_count
ssamant 7e4c786
added routes for rental optionals
ssamant 2f7cc15
created rental model
ssamant da6c2b1
controller for Rentals
ssamant 4e4757f
started model tests for rental
ssamant 3537ec2
testing rental model validations for due date
ssamant a251452
Merge pull request #12 from ssamant/check-out-rental
ssamant 4e447f9
db:reset after pull
botrethewey 39cf376
removed extra unused defult routes
botrethewey 4530b4d
added entity relationship test
botrethewey 4dbe4e9
added simple cov
botrethewey f431b51
clean up model file
botrethewey 48957ad
update rental model test
botrethewey 740928d
Merge pull request #13 from ssamant/bt-update-rentals-test
botrethewey 44848e1
added some tests
botrethewey d31ed5b
Merge pull request #14 from ssamant/add-rental-controller
botrethewey 0cf9d41
wrote controller action for rental create and updated tests
ssamant e34603e
Merge pull request #15 from ssamant/rental-create-controller
ssamant d7394fa
updated tests and controller logic
botrethewey 2097e8b
Merge pull request #16 from ssamant/update-rental-logic
botrethewey b2b9bd5
logic and tests for Movie model method available inventory
ssamant 8245341
tests for custom method check_availability in rental model
ssamant ff405d5
finised testing for rental model custom method
ssamant b72001a
Merge pull request #17 from ssamant/rental_logic_inventory
ssamant e442f2e
fix typo in movie controllers test
botrethewey 70ee7ef
added tests for the rentals custom method in model
botrethewey 2b3de18
Merge pull request #18 from ssamant/update-rental-controller-test
botrethewey 510a49d
fixed error message in rental model test
botrethewey 029a914
updated logic on movies_checked_out_count method
botrethewey 0f368f0
updated tests for the custom method
botrethewey 968032d
Merge pull request #19 from ssamant/update-customer-custom-method
botrethewey bf6306b
TDD! wrote controller tests for Rental update action
ssamant d19069c
tests for update action in Rental
ssamant 8ad3f29
WIP overdue action in rental controller
ssamant bb987ed
Merge pull request #20 from ssamant/overdue_action
ssamant 79cd476
hash to give to json in overdue action with all the required fields
ssamant 656104e
WIP changed error message in check_inventory method to give estimated…
ssamant df6b2c1
Merge pull request #21 from ssamant/sandbox_overdue
ssamant 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,4 @@ | ||
class Customer < ApplicationRecord | ||
validates :name, presence: true | ||
validates :phone, presence: true, uniqueness: true | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
class Movie < ApplicationRecord | ||
validates :title, presence: true | ||
validates :overview, presence: true | ||
validates :release_date, presence: true, format: { with: /^\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])$/, message: "must be in YYYY-MM-DD format" } | ||
validates :inventory, presence: true, numericality: { only_integer: true, greater_than: 0} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddDefaultValueCustomer < ActiveRecord::Migration[5.0] | ||
def change | ||
change_column :customers, :account_credit, :float, :default => 0.0 | ||
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
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.
Really great job with the validations!