Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
afa3f86
rails initial setup
HabenFoto May 26, 2020
2ed378f
rails inital setup
HabenFoto May 26, 2020
5f2a0ff
added routed for Customer and Video models
HabenFoto May 27, 2020
cdfe2cd
added index, create and show actions for video controller
HabenFoto May 27, 2020
6f0c6a2
added index, create and show actions for customer controller
HabenFoto May 27, 2020
78c0b38
test helpers added
HabenFoto May 27, 2020
3abc96c
added a note
May 27, 2020
bf49a07
added validations for video
HabenFoto May 27, 2020
d11a1d7
added validations for customer
HabenFoto May 27, 2020
cd25a23
Merge branch 'master' of https://github.com/HabenFoto/video-store-api
HabenFoto May 27, 2020
0b6e5a1
creared yml file for videos
HabenFoto May 27, 2020
0faba2b
created yml file for customers
HabenFoto May 27, 2020
09c1457
added customer controller test for index
HabenFoto May 27, 2020
e110d55
test for customer controller
HabenFoto May 27, 2020
36aee94
generated rentals
May 27, 2020
51ee1cf
added relationships
May 27, 2020
906574a
added show test for customer
HabenFoto May 27, 2020
85189ac
minor edit
HabenFoto May 27, 2020
b6c2444
minor edit
HabenFoto May 27, 2020
21e672a
added relationship to video
HabenFoto May 27, 2020
8ff2d5f
Merge branch 'master' of https://github.com/HabenFoto/video-store-api
HabenFoto May 27, 2020
682c562
did rails db:migrate for rental
May 27, 2020
dc54063
added relations to rental tables
HabenFoto May 28, 2020
8d50afa
Merge branch 'master' of https://github.com/HabenFoto/video-store-api
HabenFoto May 28, 2020
652d28c
added customer model tests
HabenFoto May 28, 2020
adb5688
edited out show action test for customer controller
HabenFoto May 28, 2020
363c49e
added show action for video, and wrote the index test
May 28, 2020
f6358e0
video show action test passed
May 28, 2020
20dc986
added post test for video, i failure still, will carry on tomorrow.
May 28, 2020
a1dde61
added missing API test
HabenFoto May 28, 2020
3156a3d
editedd the index action's required fields
HabenFoto May 28, 2020
28959ad
added checkout method for rental controller
HabenFoto May 28, 2020
5cd927d
edited video controller index action's required fields to match smoke…
HabenFoto May 28, 2020
a2c1374
added check-out and check-in to routes and made video as root route
HabenFoto May 28, 2020
61f210c
added video_checkedout_count to the schema
HabenFoto May 28, 2020
08362f9
uncommented video_checkedout_count in seeds
HabenFoto May 28, 2020
27c997e
added video_checkedout_count as a table
HabenFoto May 28, 2020
f24073e
minor edits
HabenFoto May 28, 2020
f6687cb
Merge branch 'master' of https://github.com/HabenFoto/video-store-api
May 28, 2020
7f308a7
added checked_in method in rentals_controller
HabenFoto May 28, 2020
42ae078
edited yml for all 3
HabenFoto May 29, 2020
28ada53
added test for rental controller for index and check_out
HabenFoto May 29, 2020
b9b2a8d
updated rentals schema
HabenFoto May 29, 2020
3d1f4e1
updated schema
HabenFoto May 29, 2020
7e0a0f3
added check_in method, not fully working
HabenFoto May 29, 2020
d903ceb
minor edit
HabenFoto May 29, 2020
32e57d8
exclude operating sytem file
HabenFoto May 29, 2020
ab90eae
added video_controller test
May 29, 2020
f301d81
Merge branch 'master' of https://github.com/HabenFoto/video-store-api
May 29, 2020
ce93f9b
updated and added more videos controller test
May 29, 2020
9a888a5
wrote and passed video model test, passed
May 29, 2020
da28df7
edited rental yml file
HabenFoto May 29, 2020
aedea20
added helper methods to implement check-in and check-out
HabenFoto May 29, 2020
586072d
added helper methods
HabenFoto May 29, 2020
3bd8e79
added validations for rental
HabenFoto May 29, 2020
2aa2bcb
added helper method
HabenFoto May 29, 2020
725f9e2
added check-in test
HabenFoto May 29, 2020
92451cb
added validation tests for rental
HabenFoto May 29, 2020
db74660
Merge branch 'master' of https://github.com/HabenFoto/video-store-api
HabenFoto May 29, 2020
d31a788
made test specific required fields
HabenFoto May 29, 2020
2a8729d
deleted un needed show action
HabenFoto May 29, 2020
52b0829
fixed fields for smoke tests
HabenFoto May 29, 2020
85a2f35
defaulted checked_out_count to 0
HabenFoto May 29, 2020
4d97222
fixed indentations & all waves /postman test passing
May 29, 2020
76fd3c6
Merge branch 'master' of https://github.com/HabenFoto/video-store-api
May 29, 2020
a4bd967
fixed indentations
May 29, 2020
36e7e41
minor edit
HabenFoto May 29, 2020
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
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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
.DS_Store
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.6.5
57 changes: 57 additions & 0 deletions Gemfile
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", ">= 6.0.3.1"
# 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
212 changes: 212 additions & 0 deletions Gemfile.lock
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, >= 6.0.3.1)
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
9 changes: 9 additions & 0 deletions Guardfile
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
6 changes: 6 additions & 0 deletions Rakefile
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
4 changes: 4 additions & 0 deletions app/channels/application_cable/channel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
4 changes: 4 additions & 0 deletions app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class ApplicationController < ActionController::API
end
Empty file added app/controllers/concerns/.keep
Empty file.
6 changes: 6 additions & 0 deletions app/controllers/customers_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class CustomersController < ApplicationController
def index
customers = Customer.order(:name).as_json(only: [:id, :name, :postal_code, :phone, :registered_at, :videos_checked_out_count])
render json: customers, status: :ok
end
end
Loading