Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MOVIEDB_KEY = 'fab6e945ca8bd693a69acea57b30c0b9'
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby 2.6.5
- name: Setup Ruby 2.6.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.5
ruby-version: 2.6.6

- name: Install PostgreSQL 11 client
run: |
Expand Down
Empty file modified .gitignore
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.6
5 changes: 4 additions & 1 deletion Gemfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'
ruby '2.6.6'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0', '>= 6.0.3.1'
Expand Down Expand Up @@ -49,6 +49,9 @@ end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f'


group :development, :test do
gem 'pry-rails'
end
Expand Down
11 changes: 9 additions & 2 deletions Gemfile.lock
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
GIT
remote: https://github.com/mimemagicrb/mimemagic.git
revision: 01f92d86d15d85cfd0f20dabd025dcbd36a8a60f
ref: 01f92d86d15d85cfd0f20dabd025dcbd36a8a60f
specs:
mimemagic (0.3.5)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -124,7 +131,6 @@ GEM
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.3)
Expand Down Expand Up @@ -230,6 +236,7 @@ DEPENDENCIES
httparty
jbuilder (~> 2.7)
listen (~> 3.2)
mimemagic!
minitest-rails
minitest-reporters
pg (>= 0.18, < 2.0)
Expand All @@ -244,7 +251,7 @@ DEPENDENCIES
will_paginate

RUBY VERSION
ruby 2.6.5p114
ruby 2.6.6

BUNDLED WITH
2.1.4
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified Rakefile
100644 → 100755
Empty file.
Empty file modified app.js
100644 → 100755
Empty file.
Binary file added app/.DS_Store
Binary file not shown.
Binary file added app/assets/.DS_Store
Binary file not shown.
Empty file modified app/assets/config/manifest.js
100644 → 100755
Empty file.
Empty file modified app/channels/application_cable/channel.rb
100644 → 100755
Empty file.
Empty file modified app/channels/application_cable/connection.rb
100644 → 100755
Empty file.
Empty file modified app/controllers/application_controller.rb
100644 → 100755
Empty file.
Empty file modified app/controllers/concerns/.keep
100644 → 100755
Empty file.
Empty file modified app/controllers/customers_controller.rb
100644 → 100755
Empty file.
Empty file modified app/controllers/rentals_controller.rb
100644 → 100755
Empty file.
16 changes: 16 additions & 0 deletions app/controllers/videos_controller.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ def show
)
end

def create
video = Video.new(
title: params[:title],
overview: params[:overview],
release_date: params[:release_date],
image_url: params[:image_url],
inventory: 5,
external_id: params[:external_id]
)
if video.save
render status: :ok, json: video
else
render status: :bad_request, json: { errors: rentals.errors.messages }
end
end

private

def require_video
Expand Down
Empty file modified app/helpers/application_helper.rb
100644 → 100755
Empty file.
Empty file modified app/helpers/customers_helper.rb
100644 → 100755
Empty file.
Empty file modified app/helpers/rentals_helper.rb
100644 → 100755
Empty file.
Empty file modified app/helpers/videos_helper.rb
100644 → 100755
Empty file.
Empty file modified app/jobs/application_job.rb
100644 → 100755
Empty file.
Empty file modified app/mailers/application_mailer.rb
100644 → 100755
Empty file.
Empty file modified app/models/application_record.rb
100644 → 100755
Empty file.
Empty file modified app/models/concerns/.keep
100644 → 100755
Empty file.
Empty file modified app/models/customer.rb
100644 → 100755
Empty file.
Empty file modified app/models/rental.rb
100644 → 100755
Empty file.
Empty file modified app/models/video.rb
100644 → 100755
Empty file.
Empty file modified app/serializers/video_serializer.rb
100644 → 100755
Empty file.
Binary file added app/views/.DS_Store
Binary file not shown.
Empty file modified app/views/layouts/application.html.erb
100644 → 100755
Empty file.
Empty file modified app/views/layouts/mailer.html.erb
100644 → 100755
Empty file.
Empty file modified app/views/layouts/mailer.text.erb
100644 → 100755
Empty file.
Empty file modified config.ru
100644 → 100755
Empty file.
Binary file added config/.DS_Store
Binary file not shown.
Empty file modified config/application.rb
100644 → 100755
Empty file.
Empty file modified config/boot.rb
100644 → 100755
Empty file.
Empty file modified config/cable.yml
100644 → 100755
Empty file.
Empty file modified config/credentials.yml.enc
100644 → 100755
Empty file.
Empty file modified config/database.yml
100644 → 100755
Empty file.
Empty file modified config/environment.rb
100644 → 100755
Empty file.
Empty file modified config/environments/development.rb
100644 → 100755
Empty file.
Empty file modified config/environments/production.rb
100644 → 100755
Empty file.
Empty file modified config/environments/test.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/application_controller_renderer.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/assets.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/backtrace_silencers.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/cookies_serializer.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/filter_parameter_logging.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/inflections.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/mime_types.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/new_framework_defaults.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/session_store.rb
100644 → 100755
Empty file.
Empty file modified config/initializers/wrap_parameters.rb
100644 → 100755
Empty file.
Empty file modified config/locales/en.yml
100644 → 100755
Empty file.
Empty file modified config/puma.rb
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion config/routes.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

resources :customers, only: [:index]

resources :videos, only: [:index, :show], param: :title
resources :videos, only: [:index, :show, :create], param: :title

post "/rentals/:title/check-out", to: "rentals#check_out", as: "check_out"
post "/rentals/:title/return", to: "rentals#check_in", as: "check_in"
Expand Down
2 changes: 1 addition & 1 deletion config/secrets.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ test:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
secret_key_base: <%= ENV["SECRET_KEY_BASE"] || 'da7849f96c38ebd65869daaa319c01acb3fb369da7c00cd7ae49b5610b65e48d23aea52b369d58394582c6500f9b51c8f0c93be3fe6b4b5c6ea0d416e3ec637d' %>
Empty file modified config/spring.rb
100644 → 100755
Empty file.
34 changes: 34 additions & 0 deletions config/storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>

local:
service: Disk
root: <%= Rails.root.join("storage") %>

# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket

# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket

# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
# microsoft:
# service: AzureStorage
# storage_account_name: your_account_name
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
# container: your_container_name

# mirror:
# service: Mirror
# primary: local
# mirrors: [ amazon, google, microsoft ]
Binary file added db/.DS_Store
Binary file not shown.
Empty file modified db/migrate/20170111220114_create_customers.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20170111220123_create_movies.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20170111220126_create_rentals.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20170117221429_add_returned_status_to_rental.rb
100644 → 100755
Empty file.
Empty file.
Empty file modified db/migrate/20170608201920_add_image_to_movie.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20180618042754_add_external_id_to_movie.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20200706194441_rename_movies_to_videos.rb
100644 → 100755
Empty file.
Empty file modified db/schema.rb
100644 → 100755
Empty file.
Empty file modified db/seeds.rb
100644 → 100755
Empty file.
Empty file modified db/seeds/customers.json
100644 → 100755
Empty file.
Empty file modified db/seeds/videos.json
100644 → 100755
Empty file.
Binary file added lib/.DS_Store
Binary file not shown.
Empty file modified lib/assets/.keep
100644 → 100755
Empty file.
Empty file modified lib/tasks/.keep
100644 → 100755
Empty file.
Empty file modified lib/video_wrapper.rb
100644 → 100755
Empty file.
Empty file modified log/.keep
100644 → 100755
Empty file.
Empty file modified package.json
100644 → 100755
Empty file.
Empty file modified public/404.html
100644 → 100755
Empty file.
Empty file modified public/422.html
100644 → 100755
Empty file.
Empty file modified public/500.html
100644 → 100755
Empty file.
Empty file modified public/apple-touch-icon-precomposed.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified public/apple-touch-icon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file modified public/favicon.ico
100644 → 100755
Empty file.
Empty file modified public/robots.txt
100644 → 100755
Empty file.
Binary file added test/.DS_Store
Binary file not shown.
Empty file modified test/controllers/.keep
100644 → 100755
Empty file.
Empty file modified test/controllers/customers_controller_test.rb
100644 → 100755
Empty file.
Empty file modified test/controllers/rentals_controller_test.rb
100644 → 100755
Empty file.
Empty file modified test/controllers/videos_controller_test.rb
100644 → 100755
Empty file.
Empty file modified test/fixtures/.keep
100644 → 100755
Empty file.
Empty file modified test/fixtures/customers.yml
100644 → 100755
Empty file.
Empty file modified test/fixtures/files/.keep
100644 → 100755
Empty file.
Empty file modified test/fixtures/rentals.yml
100644 → 100755
Empty file.
Empty file modified test/fixtures/videos.yml
100644 → 100755
Empty file.
Empty file modified test/helpers/.keep
100644 → 100755
Empty file.
Empty file modified test/integration/.keep
100644 → 100755
Empty file.
Empty file modified test/integration/cors_headers_test.rb
100644 → 100755
Empty file.
Empty file modified test/mailers/.keep
100644 → 100755
Empty file.
Empty file modified test/models/.keep
100644 → 100755
Empty file.
Empty file modified test/models/customer_test.rb
100644 → 100755
Empty file.
Empty file modified test/models/rental_test.rb
100644 → 100755
Empty file.
Empty file modified test/models/video_test.rb
100644 → 100755
Empty file.
Empty file modified test/test_helper.rb
100644 → 100755
Empty file.
Empty file modified tmp/.keep
100644 → 100755
Empty file.
Empty file modified vendor/assets/javascripts/.keep
100644 → 100755
Empty file.
Empty file modified vendor/assets/stylesheets/.keep
100644 → 100755
Empty file.
Empty file modified yarn.lock
100644 → 100755
Empty file.