forked from AdaGold/video-store-api
-
Notifications
You must be signed in to change notification settings - Fork 27
Time - Denisse & Angela #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
Open
angethuy
wants to merge
63
commits into
Ada-C13:master
Choose a base branch
from
denisseai: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.
Open
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
cdca6d3
Initial commit
denisseai 1d72dcc
created model customer
denisseai 7511b7a
created customers model
denisseai 5b6ef32
added index route
denisseai f4f957a
Added index test for customer
denisseai 2b45a54
Added rental relationship
denisseai 2844b8d
Merge pull request #1 from denisseai/customer
denisseai 5f91977
More customer file
denisseai 347cfd3
Merge pull request #2 from denisseai/customer
denisseai d654389
deleted show for customer
denisseai 2010fb0
removed show action
angethuy 1c6d5a6
generated video and rental models, added relations
angethuy a8962ef
initial generation of routes to match new models
angethuy caf7fa6
init generated tests for videos and rentals
angethuy ae59bf2
migrations to add columns to rentals and videos, modified schema
angethuy e255da0
merging in newly created models for videos and rentals, associated mi…
angethuy cdf9547
Typo
denisseai 563715c
added returned column on rentals
angethuy 3a9bdd7
removed extra column in data for now
angethuy e29ae14
modifications to rentals table
angethuy 809f3ab
syntax cleanup
angethuy 9d9c52d
added routing for videos and rentals
angethuy cbd7a53
initial scaffold for videos
angethuy 3cd09e1
Added model test for customer
denisseai 62508f4
Merge pull request #3 from denisseai/customer
denisseai 505e410
Added custom fields for customer model test
denisseai 5aa9982
added validations to video
angethuy 917a53c
added exception rescue handling to application controller
angethuy 711f112
smoke tests for index and show passing
angethuy a6f5f6b
Merge branch 'master' of https://github.com/denisseai/video-store-api…
angethuy fa32b7e
create method on videos now returning correct response data
angethuy 2487a0e
added videos count to customer index results
angethuy 408d7f5
file cleanup
angethuy 1a93499
renamed rental routes to match tests
angethuy 8419077
scaffolding for rentals controller
angethuy ca88660
Update controller test
denisseai 91da190
replaced boolean returned column with datetime returned column
angethuy dc546b8
Merge branch 'master' of https://github.com/denisseai/video-store-api
angethuy 9e3e288
updated schema
angethuy bd53752
added validation testing for customer model
angethuy 3079378
restored validations for customer model
angethuy 3f3bb92
Added test for model/video
denisseai bd97156
fixed typo in routing
angethuy 3ff3ee5
added customer tests
angethuy d00f39d
checkout method matching expected behavior, passing smoke tests
angethuy a951867
resolve merging on master to include checkout
angethuy b958fc3
removed counter cache
angethuy ea73285
refactored video count and index methods
angethuy ed8821a
stable but failing check in smoke tests
angethuy 8c18a96
added customer method to calculate number of open rentals
angethuy 95b8491
manual rollback of previous column removal
angethuy c988eea
removed available inventory column and STICKING WITH IT THIS TIME i p…
angethuy 6ae1e10
restored available inventory functionality using model method
angethuy 2a48804
fixed bug where returned videos weren't being recorded accurately
angethuy 5cf5cd3
updated schema
angethuy 5b359f7
modified responses to match spec
angethuy 2abadce
test support files
angethuy 47d7cf4
validations for video model all passing
angethuy b375d05
model validations for customer all passing
angethuy 727c861
model validations on rental passing
angethuy f5d4a5c
video controller tests passing
angethuy bc0b47d
customers controller tests passing
angethuy b84e3b5
rental controller tests passing
angethuy 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
| # | ||
| # If you find yourself ignoring temporary files generated by your text editor | ||
| # or operating system, you probably want to add a global ignore instead: | ||
| # git config --global core.excludesfile '~/.gitignore_global' | ||
|
|
||
| # Ignore bundler config. | ||
| /.bundle | ||
|
|
||
| # Ignore all logfiles and tempfiles. | ||
| /log/* | ||
| /tmp/* | ||
| !/log/.keep | ||
| !/tmp/.keep | ||
|
|
||
| # Ignore pidfiles, but keep the directory. | ||
| /tmp/pids/* | ||
| !/tmp/pids/ | ||
| !/tmp/pids/.keep | ||
|
|
||
| # Ignore uploaded files in development. | ||
| /storage/* | ||
| !/storage/.keep | ||
| .byebug_history | ||
|
|
||
| # Ignore master key for decrypting credentials and more. | ||
| /config/master.key |
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 @@ | ||
| 2.6.5 |
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,57 @@ | ||
| source 'https://rubygems.org' | ||
| git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
|
|
||
| ruby '2.6.5' | ||
|
|
||
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | ||
| gem 'rails', '~> 6.0.3' | ||
| # Use postgresql as the database for Active Record | ||
| gem 'pg', '>= 0.18', '< 2.0' | ||
| # Use Puma as the app server | ||
| gem 'puma', '~> 4.1' | ||
| # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||
| # gem 'jbuilder', '~> 2.7' | ||
| # Use Redis adapter to run Action Cable in production | ||
| # gem 'redis', '~> 4.0' | ||
| # Use Active Model has_secure_password | ||
| # gem 'bcrypt', '~> 3.1.7' | ||
|
|
||
| # Use Active Storage variant | ||
| # gem 'image_processing', '~> 1.2' | ||
|
|
||
| # Reduces boot times through caching; required in config/boot.rb | ||
| gem 'bootsnap', '>= 1.4.2', require: false | ||
|
|
||
| # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible | ||
| # gem 'rack-cors' | ||
|
|
||
| group :development, :test do | ||
| # Call 'byebug' anywhere in the code to stop execution and get a debugger console | ||
| gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] | ||
| end | ||
|
|
||
| group :development do | ||
| gem 'listen', '~> 3.2' | ||
| # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring | ||
| gem 'spring' | ||
| gem 'spring-watcher-listen', '~> 2.0.0' | ||
| end | ||
|
|
||
| # Windows does not include zoneinfo files, so bundle the tzinfo-data gem | ||
| gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] | ||
|
|
||
| group :development, :test do | ||
| gem 'pry-rails' | ||
| end | ||
|
|
||
| group :development do | ||
| gem 'guard' | ||
| gem 'guard-minitest' | ||
| gem 'debase', '>= 0.2.4.1' | ||
| gem 'ruby-debug-ide', '>= 0.7.0' | ||
| end | ||
|
|
||
| group :test do | ||
| gem 'minitest-rails' | ||
| gem 'minitest-reporters' | ||
| end |
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,212 @@ | ||
| GEM | ||
| remote: https://rubygems.org/ | ||
| specs: | ||
| actioncable (6.0.3.1) | ||
| actionpack (= 6.0.3.1) | ||
| nio4r (~> 2.0) | ||
| websocket-driver (>= 0.6.1) | ||
| actionmailbox (6.0.3.1) | ||
| actionpack (= 6.0.3.1) | ||
| activejob (= 6.0.3.1) | ||
| activerecord (= 6.0.3.1) | ||
| activestorage (= 6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| mail (>= 2.7.1) | ||
| actionmailer (6.0.3.1) | ||
| actionpack (= 6.0.3.1) | ||
| actionview (= 6.0.3.1) | ||
| activejob (= 6.0.3.1) | ||
| mail (~> 2.5, >= 2.5.4) | ||
| rails-dom-testing (~> 2.0) | ||
| actionpack (6.0.3.1) | ||
| actionview (= 6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| rack (~> 2.0, >= 2.0.8) | ||
| rack-test (>= 0.6.3) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.0, >= 1.2.0) | ||
| actiontext (6.0.3.1) | ||
| actionpack (= 6.0.3.1) | ||
| activerecord (= 6.0.3.1) | ||
| activestorage (= 6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| nokogiri (>= 1.8.5) | ||
| actionview (6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| builder (~> 3.1) | ||
| erubi (~> 1.4) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.1, >= 1.2.0) | ||
| activejob (6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| globalid (>= 0.3.6) | ||
| activemodel (6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| activerecord (6.0.3.1) | ||
| activemodel (= 6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| activestorage (6.0.3.1) | ||
| actionpack (= 6.0.3.1) | ||
| activejob (= 6.0.3.1) | ||
| activerecord (= 6.0.3.1) | ||
| marcel (~> 0.3.1) | ||
| activesupport (6.0.3.1) | ||
| concurrent-ruby (~> 1.0, >= 1.0.2) | ||
| i18n (>= 0.7, < 2) | ||
| minitest (~> 5.1) | ||
| tzinfo (~> 1.1) | ||
| zeitwerk (~> 2.2, >= 2.2.2) | ||
| ansi (1.5.0) | ||
| bootsnap (1.4.6) | ||
| msgpack (~> 1.0) | ||
| builder (3.2.4) | ||
| byebug (11.1.3) | ||
| coderay (1.1.2) | ||
| concurrent-ruby (1.1.6) | ||
| crass (1.0.6) | ||
| debase (0.2.4.1) | ||
| debase-ruby_core_source (>= 0.10.2) | ||
| debase-ruby_core_source (0.10.9) | ||
| erubi (1.9.0) | ||
| ffi (1.12.2) | ||
| formatador (0.2.5) | ||
| globalid (0.4.2) | ||
| activesupport (>= 4.2.0) | ||
| guard (2.16.2) | ||
| formatador (>= 0.2.4) | ||
| listen (>= 2.7, < 4.0) | ||
| lumberjack (>= 1.0.12, < 2.0) | ||
| nenv (~> 0.1) | ||
| notiffany (~> 0.0) | ||
| pry (>= 0.9.12) | ||
| shellany (~> 0.0) | ||
| thor (>= 0.18.1) | ||
| guard-compat (1.2.1) | ||
| guard-minitest (2.4.6) | ||
| guard-compat (~> 1.2) | ||
| minitest (>= 3.0) | ||
| i18n (1.8.2) | ||
| concurrent-ruby (~> 1.0) | ||
| listen (3.2.1) | ||
| rb-fsevent (~> 0.10, >= 0.10.3) | ||
| rb-inotify (~> 0.9, >= 0.9.10) | ||
| loofah (2.5.0) | ||
| crass (~> 1.0.2) | ||
| nokogiri (>= 1.5.9) | ||
| lumberjack (1.2.4) | ||
| mail (2.7.1) | ||
| mini_mime (>= 0.1.1) | ||
| marcel (0.3.3) | ||
| mimemagic (~> 0.3.2) | ||
| method_source (1.0.0) | ||
| mimemagic (0.3.5) | ||
| mini_mime (1.0.2) | ||
| mini_portile2 (2.4.0) | ||
| minitest (5.14.1) | ||
| minitest-rails (6.0.1) | ||
| minitest (~> 5.10) | ||
| railties (~> 6.0.0) | ||
| minitest-reporters (1.4.2) | ||
| ansi | ||
| builder | ||
| minitest (>= 5.0) | ||
| ruby-progressbar | ||
| msgpack (1.3.3) | ||
| nenv (0.3.0) | ||
| nio4r (2.5.2) | ||
| nokogiri (1.10.9) | ||
| mini_portile2 (~> 2.4.0) | ||
| notiffany (0.1.3) | ||
| nenv (~> 0.1) | ||
| shellany (~> 0.0) | ||
| pg (1.2.3) | ||
| pry (0.13.1) | ||
| coderay (~> 1.1) | ||
| method_source (~> 1.0) | ||
| pry-rails (0.3.9) | ||
| pry (>= 0.10.4) | ||
| puma (4.3.5) | ||
| nio4r (~> 2.0) | ||
| rack (2.2.2) | ||
| rack-test (1.1.0) | ||
| rack (>= 1.0, < 3) | ||
| rails (6.0.3.1) | ||
| actioncable (= 6.0.3.1) | ||
| actionmailbox (= 6.0.3.1) | ||
| actionmailer (= 6.0.3.1) | ||
| actionpack (= 6.0.3.1) | ||
| actiontext (= 6.0.3.1) | ||
| actionview (= 6.0.3.1) | ||
| activejob (= 6.0.3.1) | ||
| activemodel (= 6.0.3.1) | ||
| activerecord (= 6.0.3.1) | ||
| activestorage (= 6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| bundler (>= 1.3.0) | ||
| railties (= 6.0.3.1) | ||
| sprockets-rails (>= 2.0.0) | ||
| rails-dom-testing (2.0.3) | ||
| activesupport (>= 4.2.0) | ||
| nokogiri (>= 1.6) | ||
| rails-html-sanitizer (1.3.0) | ||
| loofah (~> 2.3) | ||
| railties (6.0.3.1) | ||
| actionpack (= 6.0.3.1) | ||
| activesupport (= 6.0.3.1) | ||
| method_source | ||
| rake (>= 0.8.7) | ||
| thor (>= 0.20.3, < 2.0) | ||
| rake (13.0.1) | ||
| rb-fsevent (0.10.4) | ||
| rb-inotify (0.10.1) | ||
| ffi (~> 1.0) | ||
| ruby-debug-ide (0.7.2) | ||
| rake (>= 0.8.1) | ||
| ruby-progressbar (1.10.1) | ||
| shellany (0.0.1) | ||
| spring (2.1.0) | ||
| spring-watcher-listen (2.0.1) | ||
| listen (>= 2.7, < 4.0) | ||
| spring (>= 1.2, < 3.0) | ||
| sprockets (4.0.0) | ||
| concurrent-ruby (~> 1.0) | ||
| rack (> 1, < 3) | ||
| sprockets-rails (3.2.1) | ||
| actionpack (>= 4.0) | ||
| activesupport (>= 4.0) | ||
| sprockets (>= 3.0.0) | ||
| thor (1.0.1) | ||
| thread_safe (0.3.6) | ||
| tzinfo (1.2.7) | ||
| thread_safe (~> 0.1) | ||
| websocket-driver (0.7.2) | ||
| websocket-extensions (>= 0.1.0) | ||
| websocket-extensions (0.1.4) | ||
| zeitwerk (2.3.0) | ||
|
|
||
| PLATFORMS | ||
| ruby | ||
|
|
||
| DEPENDENCIES | ||
| bootsnap (>= 1.4.2) | ||
| byebug | ||
| debase (>= 0.2.4.1) | ||
| guard | ||
| guard-minitest | ||
| listen (~> 3.2) | ||
| minitest-rails | ||
| minitest-reporters | ||
| pg (>= 0.18, < 2.0) | ||
| pry-rails | ||
| puma (~> 4.1) | ||
| rails (~> 6.0.3) | ||
| ruby-debug-ide (>= 0.7.0) | ||
| spring | ||
| spring-watcher-listen (~> 2.0.0) | ||
| tzinfo-data | ||
|
|
||
| RUBY VERSION | ||
| ruby 2.6.5p114 | ||
|
|
||
| BUNDLED WITH | ||
| 2.1.4 |
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,9 @@ | ||
| guard :minitest, autorun: false, spring: true do | ||
| watch(%r{^app/(.+).rb$}) { |m| "test/#{m[1]}_test.rb" } | ||
| watch(%r{^app/controllers/application_controller.rb$}) { 'test/controllers' } | ||
| watch(%r{^app/controllers/(.+)_controller.rb$}) { |m| "test/integration/#{m[1]}_test.rb" } | ||
| watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" } | ||
| watch(%r{^lib/(.+).rb$}) { |m| "test/lib/#{m[1]}_test.rb" } | ||
| watch(%r{^test/.+_test.rb$}) | ||
| watch(%r{^test/test_helper.rb$}) { 'test' } | ||
| end |
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,6 @@ | ||
| # Add your own tasks in files placed in lib/tasks ending in .rake, | ||
| # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
|
||
| require_relative 'config/application' | ||
|
|
||
| Rails.application.load_tasks |
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,4 @@ | ||
| module ApplicationCable | ||
| class Channel < ActionCable::Channel::Base | ||
| end | ||
| end |
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,4 @@ | ||
| module ApplicationCable | ||
| class Connection < ActionCable::Connection::Base | ||
| end | ||
| end |
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,3 @@ | ||
| class ApplicationController < ActionController::API | ||
|
|
||
| end |
Empty file.
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,11 @@ | ||
| class CustomersController < ApplicationController | ||
|
|
||
| def index | ||
| @customers = Customer.order(:name) | ||
| render json: @customers.to_json( | ||
| :only => [:id, :name, :registered_at, :postal_code, :phone], :methods => [:videos_checked_out_count]), status: :ok | ||
| 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.
Great job using
:methodshere!