forked from AdaGold/video-store-api
-
Notifications
You must be signed in to change notification settings - Fork 25
Leti & Maddie - VideoStoreAPI - Ampers #21
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
LetiTran
wants to merge
70
commits into
Ada-C9:master
Choose a base branch
from
LetiTran: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
70 commits
Select commit
Hold shift + click to select a range
3447199
Create initial rails files
LetiTran 8d3d5b9
Generate Controllers with methods and Models for Customer, Movie, and…
madaleines 0009505
Add foreigns to rental model
madaleines 4f5231e
Added missing columns for customers and movies
LetiTran 2eee395
Created routes and model validations
LetiTran 4c117ea
Added /zomg route
LetiTran 4367598
Added controller methods
LetiTran 0f21bb3
Added methods on movie model to return inventoy count and if self is …
LetiTran 0303b72
Added method to return movies checked out by costumer
LetiTran d67afc6
Merge branch 'leti/movie_model'
LetiTran 510e056
Add methods to Rental Model
madaleines 8ab9b78
Merge branch 'master' of https://github.com/LetiTran/VideoStoreAPI in…
madaleines c6513e8
Added movies and customers fixtures
LetiTran 45e6609
Fixed fixtures
LetiTran 0330f7d
Fixed typo in Rental model
LetiTran 4e06cf9
Fixed Rental model validations
LetiTran 34fca3d
Validate Rental model test
madaleines 6d049a1
Fixed boolean validation on Rental
LetiTran 8d34e5e
Wrote tests for Customer model.
LetiTran 53c3161
Remove date gem
madaleines eff980a
Create fixtures for Rental model tests
madaleines b76914f
Write tests for Rental model
madaleines 799bf72
Edit assign_due_date method to take date from created_at
madaleines c436828
Created tests for Movie model.
LetiTran 8fa9c18
Merging with rental model tests.
LetiTran 93cc499
initiate RABL
madaleines 6f461e3
Merge branch 'master' of https://github.com/LetiTran/VideoStoreAPI in…
madaleines aceb122
Created Customer #index and #create methods
LetiTran 3ee9a9f
Movies and Customers controller methods created and working.
LetiTran 14e2d49
Figuring out rabl
madaleines b985e10
resolve merge conflicts
madaleines 385bbef
Manipulate RABL files
madaleines 22fc41e
Changed Movie#available_inventory to work with movies that have no in…
LetiTran 327a544
Added rabl functions to Customer and Movie views.
LetiTran 5ff2ef0
remove validation for due date
madaleines a0c6adf
Write controller methods for Rental
madaleines cc73d78
resolve merge conflicts
madaleines 82e19c4
Modify Rental model tests to validate if returned is true
madaleines 5b82867
Updated Customer model tests
LetiTran 2d0abfe
Updated movie model tests to work with the new Rentals fixtures
LetiTran 63d6801
Merge branch 'master' of https://github.com/LetiTran/VideoStoreAPI in…
LetiTran 5ff86eb
remove json root and child root in config
madaleines c7cda15
Merge branch 'master' of https://github.com/LetiTran/VideoStoreAPI in…
LetiTran 14a8e82
removed config override for child node
madaleines 10a8f1b
Write controller tests for Rentals
madaleines e473386
Wrote customers_controller tests and all passing
LetiTran cae5e84
Minor refactoring in costumers controller
LetiTran 53b35bd
Wrote movie controller tests and all passing.
LetiTran df46b6e
Merge branch 'master' of https://github.com/LetiTran/VideoStoreAPI
LetiTran dc884c1
Edit routes for Rental and work on update method
madaleines f510137
Working on smoke tests for movie
LetiTran fdf2afd
modify movie controller
madaleines 026175b
working on rental tests and methods. Fixed update problem that wasnt …
LetiTran 1b2171c
Merging
LetiTran e6b68cd
Edit wording
madaleines 5164c1e
changaed customer controller test to work without required params in …
LetiTran 7facac9
FIXED SHIT AND OUR SMOKE TESTS PASS
madaleines 093290b
Fix Controller and model tests accordingly
madaleines 1a496ad
Remove unnecessary files
madaleines 5e9da55
Fixed assign_due_date method and changed rabl to display the due_date…
LetiTran 45c9350
Refactoring
LetiTran cb28255
Begin optionals for sorting
madaleines bb9717e
Merge branch 'master' of https://github.com/LetiTran/VideoStoreAPI in…
madaleines 50f010c
Deleted check-in method in rental model
LetiTran 4faa4b9
Merge branch 'master' of https://github.com/LetiTran/VideoStoreAPI
LetiTran 24c2c7e
Pagination working. Added params for pagination
LetiTran ad0593a
Working on sorting customers by name
LetiTran 0cc8610
Sorting by name working - NEED REFACTORING
LetiTran aa96b9a
Sort by name working and refactored.
LetiTran d7c047e
Movies can be sorted now too.
LetiTran 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,16 @@ | ||
| # 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 | ||
|
|
||
| .byebug_history |
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,62 @@ | ||
| 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.1.6' | ||
| # Use postgresql as the database for Active Record | ||
| gem 'pg', '>= 0.18', '< 2.0' | ||
| # Use Puma as the app server | ||
| gem 'puma', '~> 3.7' | ||
|
|
||
| # RABL for json view | ||
| gem 'rabl' | ||
| gem 'oj' | ||
| # To fix API issue with rabl and rail 5 | ||
| gem 'jbuilder' | ||
|
|
||
| gem 'has_scope', '~> 0.7.1' | ||
|
|
||
| gem 'will_paginate', '~> 3.1.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', '~> 4.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', 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 :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,170 @@ | ||
| GEM | ||
| remote: https://rubygems.org/ | ||
| specs: | ||
| actioncable (5.1.6) | ||
| actionpack (= 5.1.6) | ||
| nio4r (~> 2.0) | ||
| websocket-driver (~> 0.6.1) | ||
| actionmailer (5.1.6) | ||
| actionpack (= 5.1.6) | ||
| actionview (= 5.1.6) | ||
| activejob (= 5.1.6) | ||
| mail (~> 2.5, >= 2.5.4) | ||
| rails-dom-testing (~> 2.0) | ||
| actionpack (5.1.6) | ||
| actionview (= 5.1.6) | ||
| activesupport (= 5.1.6) | ||
| rack (~> 2.0) | ||
| rack-test (>= 0.6.3) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
| actionview (5.1.6) | ||
| activesupport (= 5.1.6) | ||
| builder (~> 3.1) | ||
| erubi (~> 1.4) | ||
| rails-dom-testing (~> 2.0) | ||
| rails-html-sanitizer (~> 1.0, >= 1.0.3) | ||
| activejob (5.1.6) | ||
| activesupport (= 5.1.6) | ||
| globalid (>= 0.3.6) | ||
| activemodel (5.1.6) | ||
| activesupport (= 5.1.6) | ||
| activerecord (5.1.6) | ||
| activemodel (= 5.1.6) | ||
| activesupport (= 5.1.6) | ||
| arel (~> 8.0) | ||
| activesupport (5.1.6) | ||
| concurrent-ruby (~> 1.0, >= 1.0.2) | ||
| i18n (>= 0.7, < 2) | ||
| minitest (~> 5.1) | ||
| tzinfo (~> 1.1) | ||
| ansi (1.5.0) | ||
| arel (8.0.0) | ||
| builder (3.2.3) | ||
| byebug (10.0.2) | ||
| coderay (1.1.2) | ||
| concurrent-ruby (1.0.5) | ||
| crass (1.0.4) | ||
| erubi (1.7.1) | ||
| ffi (1.9.23) | ||
| globalid (0.4.1) | ||
| activesupport (>= 4.2.0) | ||
| has_scope (0.7.2) | ||
| actionpack (>= 4.1) | ||
| activesupport (>= 4.1) | ||
| i18n (1.0.1) | ||
| concurrent-ruby (~> 1.0) | ||
| jbuilder (2.7.0) | ||
| activesupport (>= 4.2.0) | ||
| multi_json (>= 1.2) | ||
| listen (3.1.5) | ||
| rb-fsevent (~> 0.9, >= 0.9.4) | ||
| rb-inotify (~> 0.9, >= 0.9.7) | ||
| ruby_dep (~> 1.2) | ||
| loofah (2.2.2) | ||
| crass (~> 1.0.2) | ||
| nokogiri (>= 1.5.9) | ||
| mail (2.7.0) | ||
| mini_mime (>= 0.1.1) | ||
| method_source (0.9.0) | ||
| mini_mime (1.0.0) | ||
| mini_portile2 (2.3.0) | ||
| minitest (5.11.3) | ||
| minitest-rails (3.0.0) | ||
| minitest (~> 5.8) | ||
| railties (~> 5.0) | ||
| minitest-reporters (1.2.0) | ||
| ansi | ||
| builder | ||
| minitest (>= 5.0) | ||
| ruby-progressbar | ||
| multi_json (1.13.1) | ||
| nio4r (2.3.1) | ||
| nokogiri (1.8.2) | ||
| mini_portile2 (~> 2.3.0) | ||
| oj (3.6.0) | ||
| pg (1.0.0) | ||
| pry (0.11.3) | ||
| coderay (~> 1.1.0) | ||
| method_source (~> 0.9.0) | ||
| pry-rails (0.3.6) | ||
| pry (>= 0.10.4) | ||
| puma (3.11.4) | ||
| rabl (0.13.1) | ||
| activesupport (>= 2.3.14) | ||
| rack (2.0.5) | ||
| rack-test (1.0.0) | ||
| rack (>= 1.0, < 3) | ||
| rails (5.1.6) | ||
| actioncable (= 5.1.6) | ||
| actionmailer (= 5.1.6) | ||
| actionpack (= 5.1.6) | ||
| actionview (= 5.1.6) | ||
| activejob (= 5.1.6) | ||
| activemodel (= 5.1.6) | ||
| activerecord (= 5.1.6) | ||
| activesupport (= 5.1.6) | ||
| bundler (>= 1.3.0) | ||
| railties (= 5.1.6) | ||
| sprockets-rails (>= 2.0.0) | ||
| rails-dom-testing (2.0.3) | ||
| activesupport (>= 4.2.0) | ||
| nokogiri (>= 1.6) | ||
| rails-html-sanitizer (1.0.4) | ||
| loofah (~> 2.2, >= 2.2.2) | ||
| railties (5.1.6) | ||
| actionpack (= 5.1.6) | ||
| activesupport (= 5.1.6) | ||
| method_source | ||
| rake (>= 0.8.7) | ||
| thor (>= 0.18.1, < 2.0) | ||
| rake (12.3.1) | ||
| rb-fsevent (0.10.3) | ||
| rb-inotify (0.9.10) | ||
| ffi (>= 0.5.0, < 2) | ||
| ruby-progressbar (1.9.0) | ||
| ruby_dep (1.5.0) | ||
| spring (2.0.2) | ||
| 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.1) | ||
| actionpack (>= 4.0) | ||
| activesupport (>= 4.0) | ||
| sprockets (>= 3.0.0) | ||
| thor (0.20.0) | ||
| thread_safe (0.3.6) | ||
| tzinfo (1.2.5) | ||
| thread_safe (~> 0.1) | ||
| websocket-driver (0.6.5) | ||
| websocket-extensions (>= 0.1.0) | ||
| websocket-extensions (0.1.3) | ||
| will_paginate (3.1.6) | ||
|
|
||
| PLATFORMS | ||
| ruby | ||
|
|
||
| DEPENDENCIES | ||
| byebug | ||
| has_scope (~> 0.7.1) | ||
| jbuilder | ||
| listen (>= 3.0.5, < 3.2) | ||
| minitest-rails | ||
| minitest-reporters | ||
| oj | ||
| pg (>= 0.18, < 2.0) | ||
| pry-rails | ||
| puma (~> 3.7) | ||
| rabl | ||
| rails (~> 5.1.6) | ||
| spring | ||
| spring-watcher-listen (~> 2.0.0) | ||
| tzinfo-data | ||
| will_paginate (~> 3.1.0) | ||
|
|
||
| BUNDLED WITH | ||
| 1.16.1 |
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,34 @@ | ||
| class CustomersController < ApplicationController | ||
| def zomg | ||
| message = "it works" | ||
| render json: message.as_json | ||
| end | ||
|
|
||
| def index | ||
| params[:sort] ? (sort = params[:sort].to_sym) : sort = :id | ||
|
|
||
| @customers = Customer.order(sort).paginate(page: params[:p], per_page: params[:n]) | ||
| end | ||
|
|
||
| def create | ||
| customer = Customer.create(customers_params) | ||
|
|
||
| if customer.valid? | ||
| customer.assign_registered_date | ||
| render json: {id: customer.id}, status: :ok | ||
| else | ||
| render json: {ok: false, errors: customer.errors}, status: :bad_request | ||
| end | ||
| end | ||
|
|
||
| # (Show not required) | ||
| def show | ||
| @customer = Customer.find_by(id: params[:id]) | ||
| render json: {ok: false, error: :not_found}, status: :not_found if @customer.nil? | ||
| end | ||
|
|
||
| private | ||
| def customers_params | ||
| params.permit(:name, :phone, :address, :city, :state, :postal_code, :p, :n, :sort) | ||
| 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,31 @@ | ||
| class MoviesController < ApplicationController | ||
| def index | ||
|
|
||
| params[:sort] ? (sort = params[:sort].to_sym) : sort = :id | ||
|
|
||
| @movies = Movie.order(sort).paginate(page: params[:p], per_page: params[:n]) | ||
|
|
||
| end | ||
|
|
||
| def show | ||
|
|
||
| @movie = Movie.find_by(id: params[:id]) | ||
|
|
||
| render json: {ok: false, error: :not_found}, status: :not_found if @movie.nil? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these post-fix conditionals look really fancy and nice! |
||
| end | ||
|
|
||
| def create | ||
| movie = Movie.create(movies_params) | ||
|
|
||
| if movie.valid? | ||
| render json: {id: movie.id}, status: :ok | ||
| else | ||
| render json: {ok: false, errors: movie.errors}, status: :bad_request | ||
| end | ||
| end | ||
|
|
||
| private | ||
| def movies_params | ||
| params.permit(:title, :release_date, :overview, :inventory, :p, :n, :sort) | ||
| 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,48 @@ | ||
| class RentalsController < ApplicationController | ||
| def index | ||
| @rentals = Rental.all | ||
| end | ||
|
|
||
| def show | ||
| @rental = Rental.find_by(id: params[:id]) | ||
|
|
||
| if @rental.nil? | ||
| render json: { ok: false, error: :not_found }, status: :not_found | ||
| end | ||
| end | ||
|
|
||
| def create | ||
| movie = Movie.find_by(id: params[:movie_id]) | ||
|
|
||
| if movie.available? | ||
| rental = Rental.create(rental_params) | ||
|
|
||
| if rental.valid? | ||
| rental.assign_due_date | ||
| render json: { id: rental.id }, status: :ok | ||
| else | ||
| render json: {ok: false, errors: rental.errors}, status: :bad_request | ||
| end | ||
|
|
||
| else | ||
| render json: {ok: false, errors: "This will not work"}, status: :bad_request | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phrase "This will not work" is a little awkward sounding? |
||
| end | ||
| end | ||
|
|
||
| def update | ||
| rental = Rental.where(customer_id: params[:customer_id]).where(movie_id: params[:movie_id]).find_by(returned: false) | ||
|
|
||
| if rental | ||
| rental.update_attributes(returned: true) | ||
| render json: { id: rental.id }, status: :ok | ||
| else | ||
| render json: { ok: false, errors: "This will not work" }, status: :bad_request | ||
| end | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def rental_params | ||
| return params.permit(:customer_id, :movie_id) | ||
| end | ||
| end | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ApplicationJob < ActiveJob::Base | ||
| 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 @@ | ||
| class ApplicationMailer < ActionMailer::Base | ||
| default from: 'from@example.com' | ||
| layout 'mailer' | ||
| 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 ApplicationRecord < ActiveRecord::Base | ||
| self.abstract_class = true | ||
| end |
Empty file.
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.
this line is great! I'm a fan!
Ternaries also work so you can assign things like this (this does the same thing you did):