Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
50aa489
initial commit
stupendousC Nov 5, 2019
02ee527
set up models, controllers, and schema
stupendousC Nov 5, 2019
fdd7628
Merge pull request #1 from emilyvomacka/Caroline
stupendousC Nov 5, 2019
75be08b
fixed model typo, seeded successfully
stupendousC Nov 5, 2019
1e80897
fixed more typos, rental associations tested in rails console
stupendousC Nov 5, 2019
82ec61b
fixed datatypes into datetime
stupendousC Nov 5, 2019
4141750
Merge pull request #2 from emilyvomacka/Caroline
stupendousC Nov 5, 2019
d114e01
release_date from movies db supposed to be date and not datetime. fixed
stupendousC Nov 5, 2019
858f4f8
added model relation tests for movies
stupendousC Nov 5, 2019
4d4d22e
working on custoemr test
stupendousC Nov 5, 2019
cf910e1
Merge pull request #3 from emilyvomacka/Caroline
stupendousC Nov 5, 2019
0d722ae
added validations
emilyvomacka Nov 5, 2019
40e53b0
Merge pull request #4 from emilyvomacka/emv
emilyvomacka Nov 5, 2019
0fd2d26
actually adding tests
emilyvomacka Nov 5, 2019
092e91b
Merge pull request #5 from emilyvomacka/emv
emilyvomacka Nov 5, 2019
52a546d
added routes
stupendousC Nov 5, 2019
6625079
added avail_inventory to movies database
stupendousC Nov 5, 2019
5a30bcd
Merge pull request #6 from emilyvomacka/Caroline
stupendousC Nov 5, 2019
ab4deaf
movies#create done
stupendousC Nov 6, 2019
b5a316f
customers index
emilyvomacka Nov 6, 2019
d3c48a6
Merge pull request #7 from emilyvomacka/emv
emilyvomacka Nov 6, 2019
3ca06be
Merge branch 'master' into Caroline
stupendousC Nov 6, 2019
388a6ae
Merge pull request #8 from emilyvomacka/Caroline
stupendousC Nov 6, 2019
3be5afe
Merge branch 'master' into Caroline
stupendousC Nov 6, 2019
29f9204
edited seed file
emilyvomacka Nov 6, 2019
8d6af84
Merge pull request #9 from emilyvomacka/emv
emilyvomacka Nov 6, 2019
1e0aa47
Merge branch 'master' into Caroline
stupendousC Nov 6, 2019
bcab12b
fixed available_inventory column name
stupendousC Nov 6, 2019
f1f30c9
Merge pull request #10 from emilyvomacka/Caroline
stupendousC Nov 6, 2019
4dbafca
edited movie show status code
emilyvomacka Nov 6, 2019
e8113a2
Merge branch 'master' of https://github.com/emilyvomacka/video-store-api
emilyvomacka Nov 6, 2019
422614e
done w/ rental model relation tests
stupendousC Nov 6, 2019
80da4c3
rental model validations tests done
stupendousC Nov 6, 2019
a2e8cb3
refined testing codes for movie model relations, to be safe from futu…
stupendousC Nov 6, 2019
716750b
movies_ctrller test codes skeleton
stupendousC Nov 6, 2019
2300529
customers_ctrller test skeleton
stupendousC Nov 6, 2019
e303b5a
fixed movie_ctrller codes for postman tests
stupendousC Nov 6, 2019
62a6b8a
refined movie new_params strong parameters
stupendousC Nov 6, 2019
7f4f675
movies_checked_out_count, all wave 2 tests passing
emilyvomacka Nov 6, 2019
34a1b73
merging
stupendousC Nov 6, 2019
56e2d1a
Merge pull request #11 from emilyvomacka/Caroline
stupendousC Nov 6, 2019
50a4bf7
edited customer index to pass last test, oops
emilyvomacka Nov 6, 2019
b4ecef5
Merge branch 'master' of https://github.com/emilyvomacka/video-store-api
emilyvomacka Nov 6, 2019
ea6c7e9
just some ideas on wave4 I dont' want to forget
stupendousC Nov 6, 2019
5d117a6
finished customer testing
emilyvomacka Nov 6, 2019
c4a39d8
final customer test update
emilyvomacka Nov 6, 2019
bf83e48
rental#check-out works via manual postman testing. now only 3 errors
stupendousC Nov 6, 2019
a6ca39d
Merge pull request #12 from emilyvomacka/Caroline
stupendousC Nov 6, 2019
ccbcf8d
check-in
emilyvomacka Nov 6, 2019
4258d48
Merge pull request #13 from emilyvomacka/check-in
emilyvomacka Nov 6, 2019
f5a5e46
returned: true on check-in
emilyvomacka Nov 6, 2019
f98b57c
Merge pull request #14 from emilyvomacka/check-in
emilyvomacka Nov 6, 2019
e0a2a02
customer ctrller tests done
stupendousC Nov 7, 2019
faec3a3
setting up rentals#check_out skeleton
stupendousC Nov 7, 2019
c176eac
had to amend fixtures due to new schema additions
stupendousC Nov 7, 2019
c66f230
typo fixed
stupendousC Nov 7, 2019
79f4572
trying to fix bugs in check_out test codes
stupendousC Nov 7, 2019
34c7f38
fixed hole in logic, postman still 100% passing
stupendousC Nov 7, 2019
d186186
added some check-out edge cases
stupendousC Nov 7, 2019
3800a6d
finished customer_ctrller test codes, i think
stupendousC Nov 7, 2019
2a56a4f
clarified language in test arrangement
stupendousC Nov 7, 2019
c63ae00
rentals#check_out testing almost done except for 1 weird bug
stupendousC Nov 7, 2019
55b965a
set up rentals#check_in test skeleton
stupendousC Nov 7, 2019
ea741b4
test_helper
emilyvomacka Nov 7, 2019
4ebe917
Merge branch 'master' of https://github.com/emilyvomacka/video-store-api
emilyvomacka Nov 7, 2019
da70ee9
Merge pull request #15 from emilyvomacka/Caroline
stupendousC Nov 7, 2019
134222e
merge
emilyvomacka Nov 7, 2019
95ac7dc
fixed yml seed data discrepancy
stupendousC Nov 7, 2019
01cea08
fixed more yml errors
stupendousC Nov 7, 2019
d8e4489
fixed yml, thereby fixing test codes, yay
stupendousC Nov 7, 2019
5b1a6c5
took out unnecessary comment
stupendousC Nov 7, 2019
7236314
sorting by name/registered_at/postal_code works for Customers#index
stupendousC Nov 7, 2019
720ad98
able to use query params sort and/or n&&p, but no validations
stupendousC Nov 7, 2019
af09103
skeletons of customer ctrller test for query parameter extras
stupendousC Nov 7, 2019
e7de0fa
almost done with tetsing on query parameter :sort
stupendousC Nov 7, 2019
b50bc27
finished sort query parameter testing
stupendousC Nov 7, 2019
7d49467
huge chunk of n&p qurey parameters edge cases testing finished
stupendousC Nov 8, 2019
6ac38f2
finished testing for query parameter sort by itself, and n&p combo by…
stupendousC Nov 8, 2019
85a3db6
attempting rentals/overdue
stupendousC Nov 8, 2019
182dc72
/rentals/overdue does NOT work yet...
stupendousC Nov 8, 2019
9a397c0
set up routes with temporary default JSON msg
stupendousC Nov 8, 2019
fe48355
movies controller testing
emilyvomacka Nov 8, 2019
747d634
movies controller test
emilyvomacka Nov 8, 2019
998b2d4
merging
stupendousC Nov 8, 2019
4878c75
merging
stupendousC Nov 8, 2019
373fb8e
finished movie testing
emilyvomacka Nov 8, 2019
8abd9be
/customers/:id/current and /customers/:id/history both work
stupendousC Nov 8, 2019
35e7346
setting up movies/current & movies/history
stupendousC Nov 8, 2019
0725a19
forgot to add 1 more route for /movies/:id/current
stupendousC Nov 8, 2019
a8a13f6
/movies/:id/history and /movies/:id/current both work now. can proba…
stupendousC Nov 8, 2019
98e5fcc
rentals/overdue works
stupendousC Nov 8, 2019
7136d13
more rentals test
emilyvomacka Nov 8, 2019
b5d82ff
successful refactoring of get_db_object
stupendousC Nov 8, 2019
eec01b3
still refactoring
emilyvomacka Nov 8, 2019
9bfcb6c
successfully refactored out get_active_rentals_from() and get_past_re…
stupendousC Nov 8, 2019
4612428
ALL RENTAL TESTS PASSING
emilyvomacka Nov 8, 2019
1a1d93f
trying out query params all over Movies_ctroller
stupendousC Nov 8, 2019
b9c85c2
Movies#index query params work, but not in movies#current & movies#hi…
stupendousC Nov 8, 2019
3d93280
query parameters sort/n/p successfully implemented in movies#history …
stupendousC Nov 8, 2019
3fd7e5f
refactored out render_error_json_query_params
stupendousC Nov 8, 2019
c3c9acd
more refactoring on render_error_json
stupendousC Nov 8, 2019
29d74b2
satisfied w/ amount of refactoring done, moving on
stupendousC Nov 8, 2019
505f366
Merge pull request #16 from emilyvomacka/rentals_test
emilyvomacka Nov 8, 2019
3650805
Merge branch 'master' into experiment
stupendousC Nov 8, 2019
54706ee
Merge pull request #17 from emilyvomacka/experiment
stupendousC Nov 8, 2019
13524a3
test fixes
emilyvomacka Nov 8, 2019
c489138
test fixes
emilyvomacka Nov 8, 2019
fa21aa4
Merge pull request #18 from emilyvomacka/final_refactor
emilyvomacka Nov 8, 2019
4f0ae5d
nominal rental checkout working
emilyvomacka Nov 8, 2019
d27f77e
merging
stupendousC Nov 8, 2019
46876de
Merge branch 'master' of https://github.com/emilyvomacka/video-store-api
stupendousC Nov 8, 2019
df3832e
fixed bugs in test codes
stupendousC Nov 8, 2019
7275849
Merge pull request #19 from emilyvomacka/caroline-new
stupendousC Nov 8, 2019
169d99e
checkout/in methods
emilyvomacka Nov 8, 2019
7438ace
applied newly refactored method render_errors_json( ) to customers_ct…
stupendousC Nov 8, 2019
8298eee
applied newly refactored render_errors_json( ) to customers_ctrller
stupendousC Nov 8, 2019
72437e1
Merge pull request #20 from emilyvomacka/caroline-new
stupendousC Nov 8, 2019
03fc1a4
fixed query parameter bug
stupendousC Nov 9, 2019
0cfb72d
Merge pull request #21 from emilyvomacka/caroline-new
stupendousC Nov 9, 2019
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
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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 uploaded files in development
/storage/*
!/storage/.keep

.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.5
28 changes: 28 additions & 0 deletions Caroline_thoughts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
###### THOUGHTS...

GET /rentals/overdue
Option A: go through each affected customer?
Option B: go through each rental? No b/c worse time complexity

with optionA, I search Customer for all those who has movies_checked_out_count > 0,
then iterate thru and find customerInstance.rentals where returned: false && due_date < today

###
GET /movies/:id/current
I vote for Option A, same reason
Go through movieInstance.rentals, where returned: false

GET /movies/:id/history
Go through movieInstance.rentals, where returned: true
###


###
GET /customers/:id/current
Go through customerInstance.rentals, get all the ones with returned: false

GET /customers/:id/history
Go through customerInstance.rentals, get all the ones with returned: true
###

! Can probably refactor out some more between the prev 4 GET lines...
62 changes: 62 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.5'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# 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', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', 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.0.5', '< 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 'debase', '>= 0.2.4.1'
gem 'ruby-debug-ide', '>= 0.7.0'
end

group :test do
gem 'minitest-rails'
gem 'minitest-reporters'
end

# Supposed to help, but couldn't get it to work on stuff retrieved from db
gem 'will_paginate', '~> 3.1.0'
177 changes: 177 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.3)
actionpack (= 5.2.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.3)
actionpack (= 5.2.3)
actionview (= 5.2.3)
activejob (= 5.2.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.3)
actionview (= 5.2.3)
activesupport (= 5.2.3)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.3)
activesupport (= 5.2.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.3)
activesupport (= 5.2.3)
globalid (>= 0.3.6)
activemodel (5.2.3)
activesupport (= 5.2.3)
activerecord (5.2.3)
activemodel (= 5.2.3)
activesupport (= 5.2.3)
arel (>= 9.0)
activestorage (5.2.3)
actionpack (= 5.2.3)
activerecord (= 5.2.3)
marcel (~> 0.3.1)
activesupport (5.2.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
ansi (1.5.0)
arel (9.0.0)
bootsnap (1.4.5)
msgpack (~> 1.0)
builder (3.2.3)
byebug (11.0.1)
coderay (1.1.2)
concurrent-ruby (1.1.5)
crass (1.0.5)
debase (0.2.4.1)
debase-ruby_core_source (>= 0.10.2)
debase-ruby_core_source (0.10.6)
erubi (1.9.0)
ffi (1.11.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.7.0)
concurrent-ruby (~> 1.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.3.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mimemagic (0.3.3)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
minitest-rails (5.2.0)
minitest (~> 5.10)
railties (~> 5.2.0)
minitest-reporters (1.4.2)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
msgpack (1.3.1)
nio4r (2.5.2)
nokogiri (1.10.5)
mini_portile2 (~> 2.4.0)
pg (1.1.4)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-rails (0.3.9)
pry (>= 0.10.4)
puma (3.12.1)
rack (2.0.7)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.3)
actioncable (= 5.2.3)
actionmailer (= 5.2.3)
actionpack (= 5.2.3)
actionview (= 5.2.3)
activejob (= 5.2.3)
activemodel (= 5.2.3)
activerecord (= 5.2.3)
activestorage (= 5.2.3)
activesupport (= 5.2.3)
bundler (>= 1.3.0)
railties (= 5.2.3)
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 (5.2.3)
actionpack (= 5.2.3)
activesupport (= 5.2.3)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (13.0.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
ruby-debug-ide (0.7.0)
rake (>= 0.8.1)
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
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 (0.20.3)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
will_paginate (3.1.8)

PLATFORMS
ruby

DEPENDENCIES
bootsnap (>= 1.1.0)
byebug
debase (>= 0.2.4.1)
listen (>= 3.0.5, < 3.2)
minitest-rails
minitest-reporters
pg (>= 0.18, < 2.0)
pry-rails
puma (~> 3.11)
rails (~> 5.2.3)
ruby-debug-ide (>= 0.7.0)
spring
spring-watcher-listen (~> 2.0.0)
tzinfo-data
will_paginate (~> 3.1.0)

RUBY VERSION
ruby 2.5.5p157

BUNDLED WITH
2.0.2
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
Loading