forked from AdaGold/video-store-api
-
Notifications
You must be signed in to change notification settings - Fork 18
Queues - Erica Case, Hyunji Kim - VideoStoreAPI #23
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
ricecakemonster
wants to merge
43
commits into
Ada-C7:master
Choose a base branch
from
ricecakemonster: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
43 commits
Select commit
Hold shift + click to select a range
2da3c05
rails setup including models/migrations
EricaJCasePhD afe7630
updated migrations to have :credit_account
EricaJCasePhD c2bc689
added controllers
EricaJCasePhD c9c8281
movie model test
EricaJCasePhD 73909b8
customer model tests and rental model tests done
ricecakemonster 44ef090
merged
ricecakemonster 8f90de0
merging again
ricecakemonster 63d57e2
Update README.md
ricecakemonster 10d2be5
added routes
EricaJCasePhD 2b56272
Merge branch 'master' of https://github.com/ricecakemonster/VideoStor…
EricaJCasePhD a5e0398
mid-progress commit to pull Hyunji's work
EricaJCasePhD 7cb0e44
Merge branch 'master' of https://github.com/ricecakemonster/VideoStor…
EricaJCasePhD 3a33a7c
synced with Hyunji to get serializer setup
EricaJCasePhD 747dd27
added Serializer
ricecakemonster ee28760
movie controller tests done except error handling
EricaJCasePhD 4c4ec99
customer contoller methods added. adding a column(returned) for renta…
ricecakemonster 357e421
merged
ricecakemonster 8ece387
Rental.checkout controller works well
ricecakemonster 64b82be
securing version in remote
EricaJCasePhD ddf59f7
customer movies_checked_out_count
ricecakemonster 4d1f3b5
error handling added for movies controller
EricaJCasePhD 76714c5
merging
ricecakemonster 28ebf25
merging
ricecakemonster 7e0bb26
added checkout(that was lost somehow)
ricecakemonster 3ee993e
added overdue date to Customers
ricecakemonster f4fc68f
fixed overdue and added error messages
ricecakemonster c19f070
added available inventory
EricaJCasePhD fe407e8
customer controller tests done. over_due method fixed
ricecakemonster 0849cd7
merging
ricecakemonster 11b7ba8
created rentals controller.
ricecakemonster e6805bb
Erica's final work
EricaJCasePhD 8bfb651
fixed merge conflicts
EricaJCasePhD 988f4f5
try to Dry the code
ricecakemonster e21e586
paginate working
ricecakemonster 17d8add
paginate working for customers, rentals, and movies lists
ricecakemonster 5e59ae5
merging
ricecakemonster c90a5d3
Merge branch 'master' of https://github.com/ricecakemonster/VideoStor…
ricecakemonster 1efb061
added tests; checkout not working?
EricaJCasePhD e8bad1a
rental model tests added
ricecakemonster 9be85a7
merged
ricecakemonster d2ae71c
rental tests done.
ricecakemonster 23e7427
fixed checkin updating when one customer has checked out many copies …
ricecakemonster b957d36
added zomg
ricecakemonster 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,18 @@ | ||
| # 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 Byebug command history file. | ||
| .byebug_history | ||
| .DS_Store |
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,55 @@ | ||
| source 'https://rubygems.org' | ||
|
|
||
| git_source(:github) do |repo_name| | ||
| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") | ||
| "https://github.com/#{repo_name}.git" | ||
| end | ||
|
|
||
|
|
||
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | ||
| gem 'rails', '~> 5.0.2' | ||
| # Use postgresql as the database for Active Record | ||
| gem 'pg', '~> 0.18' | ||
| # Use Puma as the app server | ||
| gem 'puma', '~> 3.0' | ||
|
|
||
| gem 'will_paginate', '~> 3.1.0' | ||
|
|
||
| gem 'active_model_serializers', '~> 0.10.0' | ||
| # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||
| # gem 'jbuilder', '~> 2.5' | ||
| # Use Redis adapter to run Action Cable in production | ||
| # gem 'redis', '~> 3.0' | ||
| # Use ActiveModel has_secure_password | ||
| # gem 'bcrypt', '~> 3.1.7' | ||
|
|
||
| # Use Capistrano for deployment | ||
| # gem 'capistrano-rails', group: :development | ||
|
|
||
| # 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', platform: :mri | ||
| end | ||
|
|
||
| group :development do | ||
| gem 'listen', '~> 3.0.5' | ||
| # 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 do | ||
| gem 'better_errors' | ||
| gem 'pry-rails' | ||
| 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,169 @@ | ||
| GEM | ||
| remote: https://rubygems.org/ | ||
| specs: | ||
| actioncable (5.0.2) | ||
| actionpack (= 5.0.2) | ||
| nio4r (>= 1.2, < 3.0) | ||
| websocket-driver (~> 0.6.1) | ||
| actionmailer (5.0.2) | ||
| actionpack (= 5.0.2) | ||
| actionview (= 5.0.2) | ||
| activejob (= 5.0.2) | ||
| mail (~> 2.5, >= 2.5.4) | ||
| rails-dom-testing (~> 2.0) | ||
| actionpack (5.0.2) | ||
| actionview (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| rack (~> 2.0) | ||
| rack-test (~> 0.6.3) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
| actionview (5.0.2) | ||
| activesupport (= 5.0.2) | ||
| builder (~> 3.1) | ||
| erubis (~> 2.7.0) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.0, >= 1.0.3) | ||
| active_model_serializers (0.10.6) | ||
| actionpack (>= 4.1, < 6) | ||
| activemodel (>= 4.1, < 6) | ||
| case_transform (>= 0.2) | ||
| jsonapi-renderer (>= 0.1.1.beta1, < 0.2) | ||
| activejob (5.0.2) | ||
| activesupport (= 5.0.2) | ||
| globalid (>= 0.3.6) | ||
| activemodel (5.0.2) | ||
| activesupport (= 5.0.2) | ||
| activerecord (5.0.2) | ||
| activemodel (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| arel (~> 7.0) | ||
| activesupport (5.0.2) | ||
| concurrent-ruby (~> 1.0, >= 1.0.2) | ||
| i18n (~> 0.7) | ||
| minitest (~> 5.1) | ||
| tzinfo (~> 1.1) | ||
| ansi (1.5.0) | ||
| arel (7.1.4) | ||
| better_errors (2.1.1) | ||
| coderay (>= 1.0.0) | ||
| erubis (>= 2.6.6) | ||
| rack (>= 0.9.0) | ||
| builder (3.2.3) | ||
| byebug (9.0.6) | ||
| case_transform (0.2) | ||
| activesupport | ||
| coderay (1.1.1) | ||
| concurrent-ruby (1.0.5) | ||
| erubis (2.7.0) | ||
| ffi (1.9.18) | ||
| globalid (0.4.0) | ||
| activesupport (>= 4.2.0) | ||
| i18n (0.8.1) | ||
| jsonapi-renderer (0.1.2) | ||
| listen (3.0.8) | ||
| rb-fsevent (~> 0.9, >= 0.9.4) | ||
| rb-inotify (~> 0.9, >= 0.9.7) | ||
| loofah (2.0.3) | ||
| nokogiri (>= 1.5.9) | ||
| mail (2.6.5) | ||
| mime-types (>= 1.16, < 4) | ||
| method_source (0.8.2) | ||
| mime-types (3.1) | ||
| mime-types-data (~> 3.2015) | ||
| mime-types-data (3.2016.0521) | ||
| mini_portile2 (2.1.0) | ||
| minitest (5.10.1) | ||
| minitest-rails (3.0.0) | ||
| minitest (~> 5.8) | ||
| railties (~> 5.0) | ||
| minitest-reporters (1.1.14) | ||
| ansi | ||
| builder | ||
| minitest (>= 5.0) | ||
| ruby-progressbar | ||
| nio4r (2.0.0) | ||
| nokogiri (1.7.2) | ||
| mini_portile2 (~> 2.1.0) | ||
| pg (0.20.0) | ||
| pry (0.10.4) | ||
| coderay (~> 1.1.0) | ||
| method_source (~> 0.8.1) | ||
| slop (~> 3.4) | ||
| pry-rails (0.3.6) | ||
| pry (>= 0.10.4) | ||
| puma (3.8.2) | ||
| rack (2.0.2) | ||
| rack-test (0.6.3) | ||
| rack (>= 1.0) | ||
| rails (5.0.2) | ||
| actioncable (= 5.0.2) | ||
| actionmailer (= 5.0.2) | ||
| actionpack (= 5.0.2) | ||
| actionview (= 5.0.2) | ||
| activejob (= 5.0.2) | ||
| activemodel (= 5.0.2) | ||
| activerecord (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| bundler (>= 1.3.0, < 2.0) | ||
| railties (= 5.0.2) | ||
| sprockets-rails (>= 2.0.0) | ||
| rails-dom-testing (2.0.2) | ||
| activesupport (>= 4.2.0, < 6.0) | ||
| nokogiri (~> 1.6) | ||
| rails-html-sanitizer (1.0.3) | ||
| loofah (~> 2.0) | ||
| railties (5.0.2) | ||
| actionpack (= 5.0.2) | ||
| activesupport (= 5.0.2) | ||
| method_source | ||
| rake (>= 0.8.7) | ||
| thor (>= 0.18.1, < 2.0) | ||
| rake (12.0.0) | ||
| rb-fsevent (0.9.8) | ||
| rb-inotify (0.9.8) | ||
| ffi (>= 0.5.0) | ||
| ruby-progressbar (1.8.1) | ||
| slop (3.6.0) | ||
| spring (2.0.1) | ||
| activesupport (>= 4.2) | ||
| spring-watcher-listen (2.0.1) | ||
| listen (>= 2.7, < 4.0) | ||
| spring (>= 1.2, < 3.0) | ||
| sprockets (3.7.1) | ||
| concurrent-ruby (~> 1.0) | ||
| rack (> 1, < 3) | ||
| sprockets-rails (3.2.0) | ||
| actionpack (>= 4.0) | ||
| activesupport (>= 4.0) | ||
| sprockets (>= 3.0.0) | ||
| thor (0.19.4) | ||
| thread_safe (0.3.6) | ||
| tzinfo (1.2.3) | ||
| thread_safe (~> 0.1) | ||
| websocket-driver (0.6.5) | ||
| websocket-extensions (>= 0.1.0) | ||
| websocket-extensions (0.1.2) | ||
| will_paginate (3.1.5) | ||
|
|
||
| PLATFORMS | ||
| ruby | ||
|
|
||
| DEPENDENCIES | ||
| active_model_serializers (~> 0.10.0) | ||
| better_errors | ||
| byebug | ||
| listen (~> 3.0.5) | ||
| minitest-rails | ||
| minitest-reporters | ||
| pg (~> 0.18) | ||
| pry-rails | ||
| puma (~> 3.0) | ||
| rails (~> 5.0.2) | ||
| spring | ||
| spring-watcher-listen (~> 2.0.0) | ||
| tzinfo-data | ||
| will_paginate (~> 3.1.0) | ||
|
|
||
| BUNDLED WITH | ||
| 1.14.6 |
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,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,2 @@ | ||
| 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,53 @@ | ||
| class CustomersController < ApplicationController | ||
| def index | ||
|
|
||
| sort_list = ["name", "postal_code", "registered_at"] | ||
| if sort_list.include?(params[:sort]) | ||
| customers = Customer.paginate(page: params[:p], per_page: params[:n]).order(params[:sort]) | ||
| else | ||
| customers = Customer.paginate(page: params[:p], per_page: params[:n]) | ||
| end | ||
|
|
||
| if customers != [] | ||
| render json: customers, status: :ok | ||
| else | ||
| render json: {errors: "There are No Customers"}, status: :not_found | ||
| end | ||
|
|
||
| end | ||
|
|
||
| end | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| # def overdue <=== If you want to return the customer with multiple overdue movies once. | ||
| # rentals = Rental.where(returned_date: nil) | ||
| # overdue_rentals = [] | ||
| # rentals.each do |rental| | ||
| # overdue_rentals << rental if rental.due_date < Time.now | ||
| # end | ||
| # | ||
| # customers = [] | ||
| # if overdue_rentals.nil? | ||
| # render json: {errors: "No Overdue Rentals"}, status: :not_found | ||
| # else | ||
| # overdue_rentals.each do |overdue| | ||
| # customer = Customer.find_by(id: overdue.customer_id) | ||
| # unless customers.include?(customer) | ||
| # customers << customer | ||
| # end | ||
| # end | ||
| # end | ||
| # | ||
| # if customers == [] | ||
| # render json: {errors: "No Customers with Overdue Movies"}, status: :not_found | ||
| # else | ||
| # sort_list = ["overdue_title", "name", "checkout_date", "due_date"] | ||
| # if sort_list.include?(params[:sort]) | ||
| # customers = customers.sort_by{|customer| customer[params[:sort]]} | ||
| # end | ||
| # render json: customers, status: :ok, each_serializer: OverdueSerializer | ||
| # 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.
⭐️ for including a README! Documentation - especially good documentation - is so often overlooked and is super useful!