From 089b1af00a7b9ae7ec051010c4245da837b39518 Mon Sep 17 00:00:00 2001 From: Donn Felker Date: Fri, 30 May 2014 15:03:17 -0700 Subject: [PATCH 01/10] Updated charge model to included disputed field. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 14df858eb..51cc16e5f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ "amount": 4900, "currency": "usd", "refunded": false, - "customer_id" : 123 + "customer_id" : 123, + "disputed" : false } ``` From 7d362e5de331cee4823ef740bc9fc300daf8e51d Mon Sep 17 00:00:00 2001 From: Donn Felker Date: Thu, 20 Oct 2016 11:48:50 -0400 Subject: [PATCH 02/10] Updated to use MiniTest instead of Rspec --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 51cc16e5f..51f3d693d 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ ### Prerequisites -- Please note that this will require some basic [Ruby on Rails](http://rubyonrails.org/) and [RSpec](http://rspec.info/) knowledge. +- Please note that this will require some basic [Ruby on Rails](http://rubyonrails.org/) and [MiniTest](http://guides.rubyonrails.org/testing.html) knowledge. - You will need to have [Ruby on Rails](http://www.rubyonrails.org/) installed to complete this task. ## Task -- Fork this repository (if you don't know how to do that, Google is your friend). +- Fork this repository. - Create a *source* directory. - In the *source* directory, scaffold a simple Rails 4 web app that models a credit card charge. JSON data structure below: @@ -89,7 +89,7 @@ On the view that shows all charges (most likely the *GET /charges* route), creat ### Tests -Create the following RSpec tests: +Create the following MiniTest tests: 1. Verify that there are three lists on the screen. One for successful charges, one for failed charges and one for the disputed charges. 2. Verify that in the Successful charges list there are 10 line items. Verify that in the failed charges list there are 5 failed charges. Verify that in the disputed charges list there are failed charges. From 7ca60aaa0cc4213fab43aae853aec5ce1dd3bea3 Mon Sep 17 00:00:00 2001 From: Donn Felker Date: Sun, 16 Aug 2020 20:54:23 -0400 Subject: [PATCH 03/10] Updating task to include tailwind, clearer notes and additional time due to Tailwind integration. --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 51f3d693d..d5c114c76 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Rails Programming Task ### In order to be considered for a Rails position, you must complete the following steps. -*Note: This task should take no longer than 1-2 hours at the most to complete.* +*Note: This task should take no longer than 1.5-2.5 hours at the most to complete.* ### Prerequisites -- Please note that this will require some basic [Ruby on Rails](http://rubyonrails.org/) and [MiniTest](http://guides.rubyonrails.org/testing.html) knowledge. +- Please note that this will require some basic [Ruby on Rails](http://rubyonrails.org/), [MiniTest](http://guides.rubyonrails.org/testing.html), and [Tailwind CSS](https://tailwindcss.com/) knowledge. - You will need to have [Ruby on Rails](http://www.rubyonrails.org/) installed to complete this task. @@ -14,9 +14,11 @@ - Fork this repository. - Create a *source* directory. -- In the *source* directory, scaffold a simple Rails 4 web app that models a credit card charge. JSON data structure below: +- In the *source* directory, scaffold a Rails web app. +- Integrate Tailwind CSS into the Rails app. Tailwind CSS should be used to style the content. +- Create a model that represents a credit card charge. JSON data structure below: -``` +```json { "id": 9923, "created": 1389618241, @@ -96,7 +98,7 @@ Create the following MiniTest tests: ## Once Complete 1. Commit and Push your code to your new repository -2. Send us a pull request, we will review your code and get back to you +2. Send a link to the repo, we will review your code and get back to you From 0a7bc414b5119368f01e8eae4daddbbf96e28dbc Mon Sep 17 00:00:00 2001 From: Donn Felker Date: Sun, 16 Aug 2020 20:57:00 -0400 Subject: [PATCH 04/10] Adding screenshot requirement. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d5c114c76..e694a0cab 100644 --- a/README.md +++ b/README.md @@ -95,10 +95,11 @@ Create the following MiniTest tests: 1. Verify that there are three lists on the screen. One for successful charges, one for failed charges and one for the disputed charges. 2. Verify that in the Successful charges list there are 10 line items. Verify that in the failed charges list there are 5 failed charges. Verify that in the disputed charges list there are failed charges. + 3. Take screenshots of the app and include it in your repo. ## Once Complete 1. Commit and Push your code to your new repository -2. Send a link to the repo, we will review your code and get back to you +2. Send us a link to your repository, we will review your code and screenshot and get back to you From a5d5077f20cd5edb32b37d1937c4c8d01a4de929 Mon Sep 17 00:00:00 2001 From: Leo Catane Date: Wed, 3 Aug 2022 20:18:34 +0800 Subject: [PATCH 05/10] Initial commit --- source/testapp | 1 + 1 file changed, 1 insertion(+) create mode 160000 source/testapp diff --git a/source/testapp b/source/testapp new file mode 160000 index 000000000..335f20a0c --- /dev/null +++ b/source/testapp @@ -0,0 +1 @@ +Subproject commit 335f20a0c755fb3b84c7e7670169d731dda71360 From 69179a8849cd5e4ed83b5fc730962640f794c79a Mon Sep 17 00:00:00 2001 From: Leo Catane Date: Wed, 3 Aug 2022 20:23:11 +0800 Subject: [PATCH 06/10] Add models --- source/testapp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/testapp b/source/testapp index 335f20a0c..84768caa4 160000 --- a/source/testapp +++ b/source/testapp @@ -1 +1 @@ -Subproject commit 335f20a0c755fb3b84c7e7670169d731dda71360 +Subproject commit 84768caa4d5f0385b3a690b09a8736b20bd812cc From 54c9734da213aeaf1674667b090ae0aa36a9550f Mon Sep 17 00:00:00 2001 From: Leo Catane Date: Thu, 4 Aug 2022 07:36:23 +0800 Subject: [PATCH 07/10] New commits --- source/testapp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/testapp b/source/testapp index 84768caa4..3fe2aedd8 160000 --- a/source/testapp +++ b/source/testapp @@ -1 +1 @@ -Subproject commit 84768caa4d5f0385b3a690b09a8736b20bd812cc +Subproject commit 3fe2aedd8f3cee8c52113bba61146beb380cf7bd From e998921c7e512900a110866b3ea957c715a0d7f9 Mon Sep 17 00:00:00 2001 From: Leo Catane Date: Thu, 4 Aug 2022 20:32:27 +0800 Subject: [PATCH 08/10] New commits --- source/testapp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/testapp b/source/testapp index 3fe2aedd8..36aa91279 160000 --- a/source/testapp +++ b/source/testapp @@ -1 +1 @@ -Subproject commit 3fe2aedd8f3cee8c52113bba61146beb380cf7bd +Subproject commit 36aa91279f74ac4722789998b0d029aec0816f9e From 4bfb7db73fb2495253b2efcc70352ea4ad53f55f Mon Sep 17 00:00:00 2001 From: Leo Catane Date: Thu, 4 Aug 2022 20:35:19 +0800 Subject: [PATCH 09/10] Remove testapp, move files to source/ --- source/testapp | 1 - 1 file changed, 1 deletion(-) delete mode 160000 source/testapp diff --git a/source/testapp b/source/testapp deleted file mode 160000 index 36aa91279..000000000 --- a/source/testapp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 36aa91279f74ac4722789998b0d029aec0816f9e From bce5e4eb6ca4d5e01a45f7d07a4291986ed5144f Mon Sep 17 00:00:00 2001 From: Leo Catane Date: Thu, 4 Aug 2022 20:38:02 +0800 Subject: [PATCH 10/10] Fix commits --- .gitignore | 6 +- source/.DS_Store | Bin 0 -> 8196 bytes source/Gemfile | 75 + source/Gemfile.lock | 242 + source/Procfile.dev | 2 + source/README.md | 4 + source/Rakefile | 6 + source/app/.DS_Store | Bin 0 -> 8196 bytes source/app/assets/.DS_Store | Bin 0 -> 6148 bytes source/app/assets/builds/.keep | 0 source/app/assets/builds/tailwind.css | 1 + source/app/assets/config/manifest.js | 5 + source/app/assets/images/.keep | 0 source/app/assets/stylesheets/application.css | 15 + .../stylesheets/application.tailwind.css | 13 + .../app/channels/application_cable/channel.rb | 4 + .../channels/application_cable/connection.rb | 4 + .../app/controllers/application_controller.rb | 2 + source/app/controllers/charges_controller.rb | 7 + source/app/controllers/concerns/.keep | 0 source/app/helpers/application_helper.rb | 2 + source/app/helpers/charges_helper.rb | 2 + source/app/javascript/application.js | 3 + .../app/javascript/controllers/application.js | 9 + .../controllers/hello_controller.js | 7 + source/app/javascript/controllers/index.js | 11 + source/app/jobs/application_job.rb | 7 + source/app/mailers/application_mailer.rb | 4 + source/app/models/application_record.rb | 3 + source/app/models/charge.rb | 3 + source/app/models/concerns/.keep | 0 source/app/models/customer.rb | 5 + source/app/views/.DS_Store | Bin 0 -> 6148 bytes source/app/views/charges/index.html.erb | 38 + source/app/views/layouts/application.html.erb | 19 + source/app/views/layouts/mailer.html.erb | 13 + source/app/views/layouts/mailer.text.erb | 1 + source/bin/bundle | 114 + source/bin/dev | 9 + source/bin/importmap | 4 + source/bin/rails | 4 + source/bin/rake | 4 + source/bin/setup | 33 + source/config.ru | 6 + source/config/.DS_Store | Bin 0 -> 6148 bytes source/config/application.rb | 22 + source/config/boot.rb | 4 + source/config/cable.yml | 11 + source/config/credentials.yml.enc | 1 + source/config/database.yml | 25 + source/config/environment.rb | 5 + source/config/environments/development.rb | 70 + source/config/environments/production.rb | 93 + source/config/environments/test.rb | 60 + source/config/importmap.rb | 7 + source/config/initializers/assets.rb | 12 + .../initializers/content_security_policy.rb | 26 + .../initializers/filter_parameter_logging.rb | 8 + source/config/initializers/inflections.rb | 16 + .../config/initializers/permissions_policy.rb | 11 + source/config/locales/en.yml | 33 + source/config/master.key | 1 + source/config/puma.rb | 43 + source/config/routes.rb | 3 + source/config/storage.yml | 34 + source/config/tailwind.config.js | 22 + source/db/development.sqlite3 | Bin 0 -> 36864 bytes .../20220803121933_create_customers.rb | 10 + .../migrate/20220803122155_create_charges.rb | 14 + source/db/schema.rb | 34 + source/db/seeds.rb | 7 + source/db/test.sqlite3 | Bin 0 -> 36864 bytes source/lib/.DS_Store | Bin 0 -> 6148 bytes source/lib/assets/.keep | 0 source/lib/tasks/.keep | 0 source/log/.keep | 0 source/log/development.log | 2435 ++++++ source/log/test.log | 7370 +++++++++++++++++ source/public/404.html | 67 + source/public/422.html | 67 + source/public/500.html | 66 + .../public/apple-touch-icon-precomposed.png | 0 source/public/apple-touch-icon.png | 0 source/public/favicon.ico | 0 source/public/robots.txt | 1 + source/public/screen_shot_0.png | Bin 0 -> 911689 bytes source/storage/.keep | 0 source/test/.DS_Store | Bin 0 -> 8196 bytes source/test/application_system_test_case.rb | 5 + .../application_cable/connection_test.rb | 11 + source/test/controllers/.keep | 0 .../controllers/charges_controller_test.rb | 39 + source/test/fixtures/charges.yml | 161 + source/test/fixtures/customers.yml | 17 + source/test/fixtures/files/.keep | 0 source/test/helpers/.keep | 0 source/test/integration/.keep | 0 source/test/mailers/.keep | 0 source/test/models/.keep | 0 source/test/models/charge_test.rb | 7 + source/test/models/customer_test.rb | 7 + source/test/system/.keep | 0 source/test/test_helper.rb | 13 + 103 files changed, 11524 insertions(+), 1 deletion(-) create mode 100644 source/.DS_Store create mode 100644 source/Gemfile create mode 100644 source/Gemfile.lock create mode 100644 source/Procfile.dev create mode 100644 source/README.md create mode 100644 source/Rakefile create mode 100644 source/app/.DS_Store create mode 100644 source/app/assets/.DS_Store create mode 100644 source/app/assets/builds/.keep create mode 100644 source/app/assets/builds/tailwind.css create mode 100644 source/app/assets/config/manifest.js create mode 100644 source/app/assets/images/.keep create mode 100644 source/app/assets/stylesheets/application.css create mode 100644 source/app/assets/stylesheets/application.tailwind.css create mode 100644 source/app/channels/application_cable/channel.rb create mode 100644 source/app/channels/application_cable/connection.rb create mode 100644 source/app/controllers/application_controller.rb create mode 100644 source/app/controllers/charges_controller.rb create mode 100644 source/app/controllers/concerns/.keep create mode 100644 source/app/helpers/application_helper.rb create mode 100644 source/app/helpers/charges_helper.rb create mode 100644 source/app/javascript/application.js create mode 100644 source/app/javascript/controllers/application.js create mode 100644 source/app/javascript/controllers/hello_controller.js create mode 100644 source/app/javascript/controllers/index.js create mode 100644 source/app/jobs/application_job.rb create mode 100644 source/app/mailers/application_mailer.rb create mode 100644 source/app/models/application_record.rb create mode 100644 source/app/models/charge.rb create mode 100644 source/app/models/concerns/.keep create mode 100644 source/app/models/customer.rb create mode 100644 source/app/views/.DS_Store create mode 100644 source/app/views/charges/index.html.erb create mode 100644 source/app/views/layouts/application.html.erb create mode 100644 source/app/views/layouts/mailer.html.erb create mode 100644 source/app/views/layouts/mailer.text.erb create mode 100755 source/bin/bundle create mode 100755 source/bin/dev create mode 100755 source/bin/importmap create mode 100755 source/bin/rails create mode 100755 source/bin/rake create mode 100755 source/bin/setup create mode 100644 source/config.ru create mode 100644 source/config/.DS_Store create mode 100644 source/config/application.rb create mode 100644 source/config/boot.rb create mode 100644 source/config/cable.yml create mode 100644 source/config/credentials.yml.enc create mode 100644 source/config/database.yml create mode 100644 source/config/environment.rb create mode 100644 source/config/environments/development.rb create mode 100644 source/config/environments/production.rb create mode 100644 source/config/environments/test.rb create mode 100644 source/config/importmap.rb create mode 100644 source/config/initializers/assets.rb create mode 100644 source/config/initializers/content_security_policy.rb create mode 100644 source/config/initializers/filter_parameter_logging.rb create mode 100644 source/config/initializers/inflections.rb create mode 100644 source/config/initializers/permissions_policy.rb create mode 100644 source/config/locales/en.yml create mode 100644 source/config/master.key create mode 100644 source/config/puma.rb create mode 100644 source/config/routes.rb create mode 100644 source/config/storage.yml create mode 100644 source/config/tailwind.config.js create mode 100644 source/db/development.sqlite3 create mode 100644 source/db/migrate/20220803121933_create_customers.rb create mode 100644 source/db/migrate/20220803122155_create_charges.rb create mode 100644 source/db/schema.rb create mode 100644 source/db/seeds.rb create mode 100644 source/db/test.sqlite3 create mode 100644 source/lib/.DS_Store create mode 100644 source/lib/assets/.keep create mode 100644 source/lib/tasks/.keep create mode 100644 source/log/.keep create mode 100644 source/log/development.log create mode 100644 source/log/test.log create mode 100644 source/public/404.html create mode 100644 source/public/422.html create mode 100644 source/public/500.html create mode 100644 source/public/apple-touch-icon-precomposed.png create mode 100644 source/public/apple-touch-icon.png create mode 100644 source/public/favicon.ico create mode 100644 source/public/robots.txt create mode 100644 source/public/screen_shot_0.png create mode 100644 source/storage/.keep create mode 100644 source/test/.DS_Store create mode 100644 source/test/application_system_test_case.rb create mode 100644 source/test/channels/application_cable/connection_test.rb create mode 100644 source/test/controllers/.keep create mode 100644 source/test/controllers/charges_controller_test.rb create mode 100644 source/test/fixtures/charges.yml create mode 100644 source/test/fixtures/customers.yml create mode 100644 source/test/fixtures/files/.keep create mode 100644 source/test/helpers/.keep create mode 100644 source/test/integration/.keep create mode 100644 source/test/mailers/.keep create mode 100644 source/test/models/.keep create mode 100644 source/test/models/charge_test.rb create mode 100644 source/test/models/customer_test.rb create mode 100644 source/test/system/.keep create mode 100644 source/test/test_helper.rb diff --git a/.gitignore b/.gitignore index 54cb8bbbc..ddefe1b4e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,8 @@ capybara-*.html /spec/tmp/* **.orig rerun.txt -pickle-email-*.html \ No newline at end of file +pickle-email-*.html + +/source/tmp/* +/source/log/* +/source/db/*.sqlite3 diff --git a/source/.DS_Store b/source/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a5bc11d94c79757d7bd4b20266dc512698c985c0 GIT binary patch literal 8196 zcmeHM&ubGw6n@i$G+>pqROmr)y+sgg!GnTGTH-;(RPEJ6nxsZ?lTE8FMG*Gl-IM4+ z5&Q%6-iv~Ff1LamJbD#Gzc(|x`)0S>qgXlvGjEyiz4_jJlikfrh)At$50;1)h^UUv zws8!@K8@r z*2cz~a8kDTP?lNQ3PovltRHB1QY~Zs=oRn^6cymwy+Z3Wp-DKD_50R!|Jm{Zk$lS^W;*G4 zhBz0X*?AUGhi~o+GuH5F-Nt8#v+X;29{;_S$0c`o`p3IB$$5%3WCmqEP97%~Ige?2 zNRP0CE!;mt+Hf*qyx<{o`FQ4JqI+%~nN7KulaFDmBAX4)$<1W`E#MTBIXrnjpX4C$ z>@@bnUEY|PE8rdFo*!RV8yO-wclUl?viFpYllv{Al22W*=f8t}j&V0Zd%4%?mwW6` zBY{iq+mF*{SI#HfbD59KqrM)4#y79Pp;n+`vR~l(|7!W~|A%^yK6$TzSKwd;RJFa< zUV)FTtqa~>Sw=yDuZm*cSMABMON;L0&AYhz 7.0.2", ">= 7.0.2.3" + +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem "sprockets-rails" + +# Use sqlite3 as the database for Active Record +gem "sqlite3", "~> 1.4" + +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", "~> 5.0" + +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem "importmap-rails" + +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" + +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" + +# Use Tailwind CSS [https://github.com/rails/tailwindcss-rails] +gem "tailwindcss-rails" + +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Redis adapter to run Action Cable in production +gem "redis", "~> 4.0" + +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +# Use Sass to process CSS +# gem "sassc-rails" + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +# gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri mingw x64_mingw ] +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" + + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" + + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" + gem "webdrivers" +end diff --git a/source/Gemfile.lock b/source/Gemfile.lock new file mode 100644 index 000000000..a2ee2b09a --- /dev/null +++ b/source/Gemfile.lock @@ -0,0 +1,242 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.3.1) + actionpack (= 7.0.3.1) + activesupport (= 7.0.3.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.3.1) + actionpack (= 7.0.3.1) + activejob (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.3.1) + actionpack (= 7.0.3.1) + actionview (= 7.0.3.1) + activejob (= 7.0.3.1) + activesupport (= 7.0.3.1) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.3.1) + actionview (= 7.0.3.1) + activesupport (= 7.0.3.1) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.3.1) + actionpack (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.3.1) + activesupport (= 7.0.3.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.3.1) + activesupport (= 7.0.3.1) + globalid (>= 0.3.6) + activemodel (7.0.3.1) + activesupport (= 7.0.3.1) + activerecord (7.0.3.1) + activemodel (= 7.0.3.1) + activesupport (= 7.0.3.1) + activestorage (7.0.3.1) + actionpack (= 7.0.3.1) + activejob (= 7.0.3.1) + activerecord (= 7.0.3.1) + activesupport (= 7.0.3.1) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.3.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + bindex (0.8.1) + bootsnap (1.13.0) + msgpack (~> 1.2) + builder (3.2.4) + capybara (3.37.1) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + childprocess (4.1.0) + concurrent-ruby (1.1.10) + crass (1.0.6) + debug (1.6.1) + irb (>= 1.3.6) + reline (>= 0.3.1) + digest (3.1.0) + erubi (1.11.0) + globalid (1.0.0) + activesupport (>= 5.0) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + importmap-rails (1.1.5) + actionpack (>= 6.0.0) + railties (>= 6.0.0) + io-console (0.5.11) + irb (1.4.1) + reline (>= 0.3.0) + jbuilder (2.11.5) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + loofah (2.18.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (1.0.2) + matrix (0.4.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.16.2) + msgpack (1.5.4) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.3) + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout + nio4r (2.5.8) + nokogiri (1.13.8-x86_64-darwin) + racc (~> 1.4) + public_suffix (4.0.7) + puma (5.6.4) + nio4r (~> 2.0) + racc (1.6.0) + rack (2.2.4) + rack-test (2.0.2) + rack (>= 1.3) + rails (7.0.3.1) + actioncable (= 7.0.3.1) + actionmailbox (= 7.0.3.1) + actionmailer (= 7.0.3.1) + actionpack (= 7.0.3.1) + actiontext (= 7.0.3.1) + actionview (= 7.0.3.1) + activejob (= 7.0.3.1) + activemodel (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) + bundler (>= 1.15.0) + railties (= 7.0.3.1) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) + railties (7.0.3.1) + actionpack (= 7.0.3.1) + activesupport (= 7.0.3.1) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rake (13.0.6) + redis (4.7.1) + regexp_parser (2.5.0) + reline (0.3.1) + io-console (~> 0.5) + rexml (3.2.5) + rubyzip (2.3.2) + selenium-webdriver (4.3.0) + childprocess (>= 0.5, < 5.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + sprockets (4.1.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.4.4) + stimulus-rails (1.1.0) + railties (>= 6.0.0) + strscan (3.0.4) + tailwindcss-rails (2.0.10-x86_64-darwin) + railties (>= 6.0.0) + thor (1.2.1) + timeout (0.3.0) + turbo-rails (1.1.1) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) + web-console (4.2.0) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webdrivers (5.0.0) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (~> 4.0) + websocket (1.2.9) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.0) + +PLATFORMS + x86_64-darwin-20 + +DEPENDENCIES + bootsnap + capybara + debug + importmap-rails + jbuilder + puma (~> 5.0) + rails (~> 7.0.2, >= 7.0.2.3) + redis (~> 4.0) + selenium-webdriver + sprockets-rails + sqlite3 (~> 1.4) + stimulus-rails + tailwindcss-rails + turbo-rails + tzinfo-data + web-console + webdrivers + +RUBY VERSION + ruby 2.7.2p137 + +BUNDLED WITH + 2.2.2 diff --git a/source/Procfile.dev b/source/Procfile.dev new file mode 100644 index 000000000..023e98a01 --- /dev/null +++ b/source/Procfile.dev @@ -0,0 +1,2 @@ +web: bin/rails server -p 3000 +css: bin/rails tailwindcss:watch diff --git a/source/README.md b/source/README.md new file mode 100644 index 000000000..8575048d2 --- /dev/null +++ b/source/README.md @@ -0,0 +1,4 @@ +# README + +## Screenshot +![Screenshot](public/screen_shot_0.png) diff --git a/source/Rakefile b/source/Rakefile new file mode 100644 index 000000000..9a5ea7383 --- /dev/null +++ b/source/Rakefile @@ -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 diff --git a/source/app/.DS_Store b/source/app/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..909b67e29c52bb18fc546fd351cd4ac63f7cd1e8 GIT binary patch literal 8196 zcmeHMzfT)66n>^@h>9vPX5$8i4nZQN>dJwxV?mUu5(DH%OQNI~H38P+uc%b1TNkzt z{R0@7yLMo$+A_fk6Q6%1@tu8StE%MrWWST&_v|m9%~{V7k=Q(HREf$&R6><@aRH5| zNWZL3nKM1humbT!1L}9)S9j}ix96a_gB4%}SOHdm6<`Ja2L*6u%TmfY_qCT>R)7_l zNd@HhAwZQjG&a#zeLB#n6acn>ZdLG(JV3<+#)ifw+Nw~Dsj~-RLWM~&gbs&4kZ{=0 z*hE_$PC|#1Ff$92p$IiQ;sOOH5o*gVE5Hi43dr2ONC(u%({%Iq%CD@y8%I&C6W7pR z`gZnrW&8EThKp%T#PkmBdxCuofiFOv4#DLEo+fpiyM(VkjLoP1^Kr)N#$!$o z;nKVU$!h_;VsIMJN7xRYCf+hP9pYI&(&o5+{%Prp=9n|C&2%!_!*?DkO8t61p7att zGYFgC#^u_J9nH@{jTOvCdH6h`Hdggm?Xo(QYk}DyeNR-_11m4i=JxaLamDPn9PF6k zBy5^zi0N?>wXwc6XJwz-KAX?w_nYB<8^zkI=kurMRj1WFb)ikmzpv;WX3rpO4yS)c z930eGjeL}cPZ4}#YIy$!ufQhdx4Bf7pWnS1eh;iMY)$eoX&$SXh8|v!%fG9+}(I#Xt zxwRvR%(Vm5eN5I^^bGCCH7i4le?_p{u5 zmdE?i+mc6SjVzCt;w6H$jowk*m*hd@2WC;sn+`J zJl{b0s{Jhm*t5kNO^51L0aZX1_*Ovnhk!#c^q4xdTL+yz0ubvATjRCup~OG}#L#2v zkP(`3r9@Y1{1L;ra>fIn7kW$`x^fu%WUk|%Z2Squ*rzid*mRiCp?Xz7704@4bGI$& z|0mVw|9p|&sRF9Nzf!=|qi)pUPx8IB^y8%01{@b0Vv?6Sv?X-D9oq|O#oHX#I2XtT VG4z-^WQ3-F1gs3|RDmB=;1kMal6L?A literal 0 HcmV?d00001 diff --git a/source/app/assets/builds/.keep b/source/app/assets/builds/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/source/app/assets/builds/tailwind.css b/source/app/assets/builds/tailwind.css new file mode 100644 index 000000000..3bb63f7f8 --- /dev/null +++ b/source/app/assets/builds/tailwind.css @@ -0,0 +1 @@ +/*! tailwindcss v3.1.3 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:Inter var,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}select{color-adjust:exact;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact}[multiple]{color-adjust:unset;background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset}[type=checkbox],[type=radio]{color-adjust:exact;--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=checkbox]:indeterminate,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:#0000}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:#0000}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px auto -webkit-focus-ring-color}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.mx-auto{margin-left:auto;margin-right:auto}.mt-28{margin-top:7rem}.inline{display:inline}.flex{display:flex}.border{border-width:1px}.bg-\[\#FF0000\]{--tw-bg-opacity:1;background-color:rgb(255 0 0/var(--tw-bg-opacity))}.bg-\[\#FF5400\]{--tw-bg-opacity:1;background-color:rgb(255 84 0/var(--tw-bg-opacity))}.px-5{padding-left:1.25rem;padding-right:1.25rem}.text-3xl{font-size:1.875rem;line-height:2.25rem} \ No newline at end of file diff --git a/source/app/assets/config/manifest.js b/source/app/assets/config/manifest.js new file mode 100644 index 000000000..b06fc42ac --- /dev/null +++ b/source/app/assets/config/manifest.js @@ -0,0 +1,5 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css +//= link_tree ../../javascript .js +//= link_tree ../../../vendor/javascript .js +//= link_tree ../builds diff --git a/source/app/assets/images/.keep b/source/app/assets/images/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/source/app/assets/stylesheets/application.css b/source/app/assets/stylesheets/application.css new file mode 100644 index 000000000..288b9ab71 --- /dev/null +++ b/source/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/source/app/assets/stylesheets/application.tailwind.css b/source/app/assets/stylesheets/application.tailwind.css new file mode 100644 index 000000000..8666d2f3c --- /dev/null +++ b/source/app/assets/stylesheets/application.tailwind.css @@ -0,0 +1,13 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* + +@layer components { + .btn-primary { + @apply py-2 px-4 bg-blue-200; + } +} + +*/ diff --git a/source/app/channels/application_cable/channel.rb b/source/app/channels/application_cable/channel.rb new file mode 100644 index 000000000..d67269728 --- /dev/null +++ b/source/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/source/app/channels/application_cable/connection.rb b/source/app/channels/application_cable/connection.rb new file mode 100644 index 000000000..0ff5442f4 --- /dev/null +++ b/source/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/source/app/controllers/application_controller.rb b/source/app/controllers/application_controller.rb new file mode 100644 index 000000000..09705d12a --- /dev/null +++ b/source/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/source/app/controllers/charges_controller.rb b/source/app/controllers/charges_controller.rb new file mode 100644 index 000000000..8deed8797 --- /dev/null +++ b/source/app/controllers/charges_controller.rb @@ -0,0 +1,7 @@ +class ChargesController < ApplicationController + def index + @successful_charges = Charge.where(paid: true) + @failed_charges = Charge.where(paid: false, disputed: false) + @disputed_charges = Charge.where(disputed: true) + end +end diff --git a/source/app/controllers/concerns/.keep b/source/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/source/app/helpers/application_helper.rb b/source/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/source/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/source/app/helpers/charges_helper.rb b/source/app/helpers/charges_helper.rb new file mode 100644 index 000000000..414ee900f --- /dev/null +++ b/source/app/helpers/charges_helper.rb @@ -0,0 +1,2 @@ +module ChargesHelper +end diff --git a/source/app/javascript/application.js b/source/app/javascript/application.js new file mode 100644 index 000000000..0d7b49404 --- /dev/null +++ b/source/app/javascript/application.js @@ -0,0 +1,3 @@ +// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails +import "@hotwired/turbo-rails" +import "controllers" diff --git a/source/app/javascript/controllers/application.js b/source/app/javascript/controllers/application.js new file mode 100644 index 000000000..1213e85c7 --- /dev/null +++ b/source/app/javascript/controllers/application.js @@ -0,0 +1,9 @@ +import { Application } from "@hotwired/stimulus" + +const application = Application.start() + +// Configure Stimulus development experience +application.debug = false +window.Stimulus = application + +export { application } diff --git a/source/app/javascript/controllers/hello_controller.js b/source/app/javascript/controllers/hello_controller.js new file mode 100644 index 000000000..5975c0789 --- /dev/null +++ b/source/app/javascript/controllers/hello_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + connect() { + this.element.textContent = "Hello World!" + } +} diff --git a/source/app/javascript/controllers/index.js b/source/app/javascript/controllers/index.js new file mode 100644 index 000000000..54ad4cad4 --- /dev/null +++ b/source/app/javascript/controllers/index.js @@ -0,0 +1,11 @@ +// Import and register all your controllers from the importmap under controllers/* + +import { application } from "controllers/application" + +// Eager load all controllers defined in the import map under controllers/**/*_controller +import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" +eagerLoadControllersFrom("controllers", application) + +// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) +// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" +// lazyLoadControllersFrom("controllers", application) diff --git a/source/app/jobs/application_job.rb b/source/app/jobs/application_job.rb new file mode 100644 index 000000000..d394c3d10 --- /dev/null +++ b/source/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/source/app/mailers/application_mailer.rb b/source/app/mailers/application_mailer.rb new file mode 100644 index 000000000..3c34c8148 --- /dev/null +++ b/source/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/source/app/models/application_record.rb b/source/app/models/application_record.rb new file mode 100644 index 000000000..b63caeb8a --- /dev/null +++ b/source/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/source/app/models/charge.rb b/source/app/models/charge.rb new file mode 100644 index 000000000..82e11f8af --- /dev/null +++ b/source/app/models/charge.rb @@ -0,0 +1,3 @@ +class Charge < ApplicationRecord + belongs_to :customer +end diff --git a/source/app/models/concerns/.keep b/source/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/source/app/models/customer.rb b/source/app/models/customer.rb new file mode 100644 index 000000000..bddc67959 --- /dev/null +++ b/source/app/models/customer.rb @@ -0,0 +1,5 @@ +class Customer < ApplicationRecord + def full_name + [first_name, last_name].join(" ") + end +end diff --git a/source/app/views/.DS_Store b/source/app/views/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1b091d6f67305eaed04ecdd629828ce3cd2914b1 GIT binary patch literal 6148 zcmeHKu};G<5Iv`r2x95ThChM+fvLg>OIHSHi`pSkD%uWg`4N7CZ$SJ35(_&kBOCAT zoYE+*)Cr;LPC7s5d}m*ttz1k*Zm^p4iF!noLK%}|G+TtnSzD4s3lBP(V@mh5$fy0` zxNLcw;Xg9Kdv`=*n$aCS(8m51b4|DN-1aESEF0zJ2qWq1$J^P{)yu^;ugM->^BJF( zdNn?W$R|fOk5tl%mi2k6J(AD1$7Vh^?_b~7bv})Git;y~-CoUn&N&|wW55_N1`dq@ z)NGdYMA2Gfz!)$F)(r6X!9y8C#7a><9cbhV0PMmng1-F20X-XlA!4Nn3&d$CP(xk3 zVmJ+l-ABI=u~O7|Wf-1x0I(0b`)aKt~^YT>me3-~XFI_GAng z0|&)`>t@4jfLDsOwe@mbYd!Q9%EEq?;yMH!DaG*RQhW*(f!%Wl7$R1Rut4lbKxnYW J82D2LegKqOQm_C3 literal 0 HcmV?d00001 diff --git a/source/app/views/charges/index.html.erb b/source/app/views/charges/index.html.erb new file mode 100644 index 000000000..d0a512455 --- /dev/null +++ b/source/app/views/charges/index.html.erb @@ -0,0 +1,38 @@ +
+

Failed Charges

+
    + <% @failed_charges.each do |charge| %> +
  • + <%= charge.customer.full_name %> + <%= charge.amount %> + <%= charge.created_at.strftime("%m/%d/%Y") %> +
  • + <% end %> +
+ +
+ +

Disputed Charges

+
    + <% @disputed_charges.each do |charge| %> +
  • + <%= charge.customer.full_name %> + <%= charge.amount %> + <%= charge.created_at.strftime("%m/%d/%Y") %> +
  • + <% end %> +
+ +
+ +

Successful Charges

+
    + <% @successful_charges.each do |charge| %> +
  • + <%= charge.customer.full_name %> + <%= charge.amount %> + <%= charge.created_at.strftime("%m/%d/%Y") %> +
  • + <% end %> +
+
diff --git a/source/app/views/layouts/application.html.erb b/source/app/views/layouts/application.html.erb new file mode 100644 index 000000000..e6416b32b --- /dev/null +++ b/source/app/views/layouts/application.html.erb @@ -0,0 +1,19 @@ + + + + Testapp + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> + + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + + + +
+ <%= yield %> +
+ + diff --git a/source/app/views/layouts/mailer.html.erb b/source/app/views/layouts/mailer.html.erb new file mode 100644 index 000000000..cbd34d2e9 --- /dev/null +++ b/source/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/source/app/views/layouts/mailer.text.erb b/source/app/views/layouts/mailer.text.erb new file mode 100644 index 000000000..37f0bddbd --- /dev/null +++ b/source/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/source/bin/bundle b/source/bin/bundle new file mode 100755 index 000000000..a71368e32 --- /dev/null +++ b/source/bin/bundle @@ -0,0 +1,114 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../../Gemfile", __FILE__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_version + @bundler_version ||= + env_var_version || cli_arg_version || + lockfile_version + end + + def bundler_requirement + return "#{Gem::Requirement.default}.a" unless bundler_version + + bundler_gem_version = Gem::Version.new(bundler_version) + + requirement = bundler_gem_version.approximate_recommendation + + return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0") + + requirement += ".a" if bundler_gem_version.prerelease? + + requirement + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem "bundler", bundler_requirement + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/source/bin/dev b/source/bin/dev new file mode 100755 index 000000000..2daf77649 --- /dev/null +++ b/source/bin/dev @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if ! command -v foreman &> /dev/null +then + echo "Installing foreman..." + gem install foreman +fi + +foreman start -f Procfile.dev diff --git a/source/bin/importmap b/source/bin/importmap new file mode 100755 index 000000000..36502ab16 --- /dev/null +++ b/source/bin/importmap @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby + +require_relative "../config/application" +require "importmap/commands" diff --git a/source/bin/rails b/source/bin/rails new file mode 100755 index 000000000..efc037749 --- /dev/null +++ b/source/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/source/bin/rake b/source/bin/rake new file mode 100755 index 000000000..4fbf10b96 --- /dev/null +++ b/source/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/source/bin/setup b/source/bin/setup new file mode 100755 index 000000000..ec47b79b3 --- /dev/null +++ b/source/bin/setup @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/source/config.ru b/source/config.ru new file mode 100644 index 000000000..4a3c09a68 --- /dev/null +++ b/source/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/source/config/.DS_Store b/source/config/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ca662cdd016bbca6d44b6a9c4f5f2bf9885f758a GIT binary patch literal 6148 zcmeHK%}T>S5T3OGi|wH&@fhF0dKY4eM@8uiXn#p`2SMMQNtW3YkniSc{(lCAlkCeXcQjl{OIsue|7%g zTltfVJeM7&)CA)(d51^9dj;f#^T zOi_*w1i1nL19Xd_Ej0xgatAQ-m?@$M=5#1fhdO`7a5^0Qq0fsvW{NtToO~Jc_%Azu zLvg;Mxlq!{MT!lTM@BhU?_GAi}0)I*Y7sTDTgC+UeT3Q^}+7NyU pXXCs~QHCJ+ax4ul#anPOybHMjj67zF=z-affXHCM6!=jE-T + channel_prefix: testapp_production diff --git a/source/config/credentials.yml.enc b/source/config/credentials.yml.enc new file mode 100644 index 000000000..3deb3a881 --- /dev/null +++ b/source/config/credentials.yml.enc @@ -0,0 +1 @@ +XFqTnC42lBhU/ehdOiA4e2Jr1W6vxtfCkz2A7c0hXeAuy+cgYP0WHcfrEZKHvRiIOExSl2bcbWqoC/ltFAog1OlgB+3ft8ZIm2ci6FdBEpa5krhchqNjyCMNMYIlTZinlLrq6d+7qiUK1bEIwYQvZiM65ZKh9sREUelvEjU/Lm5+T94h2eZUdekRpwyKMOsDnUTguiFS6+dhHdgAF978hz8bgkymeDvqI70XppaA0ME8yZAUnTfC1SpQp3gHesAGKpYU3zZtx2z7a9VWXT0SvDgXjTQiElvxZrHxuxtLOoPkwoNg/5qAVG3hatyAoUFozR5uPhb6oEozeWp+N0ZxokQeONCX/59pOnKHkU142zkEuu8CrnhMFJv0J4TMyC7p0f0gegY817NyWUqE2YQSBjocY4IDFucyPXR1--sYP6tdvkCxMawAIT--bP7UvJRfJE33KQvbjsJoAA== \ No newline at end of file diff --git a/source/config/database.yml b/source/config/database.yml new file mode 100644 index 000000000..fcba57f19 --- /dev/null +++ b/source/config/database.yml @@ -0,0 +1,25 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/source/config/environment.rb b/source/config/environment.rb new file mode 100644 index 000000000..cac531577 --- /dev/null +++ b/source/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/source/config/environments/development.rb b/source/config/environments/development.rb new file mode 100644 index 000000000..8500f459a --- /dev/null +++ b/source/config/environments/development.rb @@ -0,0 +1,70 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true +end diff --git a/source/config/environments/production.rb b/source/config/environments/production.rb new file mode 100644 index 000000000..a8d94dffc --- /dev/null +++ b/source/config/environments/production.rb @@ -0,0 +1,93 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = "wss://example.com/cable" + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). + config.log_level = :info + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "testapp_production" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require "syslog/logger" + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/source/config/environments/test.rb b/source/config/environments/test.rb new file mode 100644 index 000000000..6ea4d1e70 --- /dev/null +++ b/source/config/environments/test.rb @@ -0,0 +1,60 @@ +require "active_support/core_ext/integer/time" + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Turn false under Spring and add config.action_view.cache_template_loading = true. + config.cache_classes = true + + # Eager loading loads your whole application. When running a single test locally, + # this probably isn't necessary. It's a good idea to do in a continuous integration + # system, or in some way before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.cache_store = :null_store + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true +end diff --git a/source/config/importmap.rb b/source/config/importmap.rb new file mode 100644 index 000000000..8dce42d40 --- /dev/null +++ b/source/config/importmap.rb @@ -0,0 +1,7 @@ +# Pin npm packages by running ./bin/importmap + +pin "application", preload: true +pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true +pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true +pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true +pin_all_from "app/javascript/controllers", under: "controllers" diff --git a/source/config/initializers/assets.rb b/source/config/initializers/assets.rb new file mode 100644 index 000000000..2eeef966f --- /dev/null +++ b/source/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/source/config/initializers/content_security_policy.rb b/source/config/initializers/content_security_policy.rb new file mode 100644 index 000000000..3621f97f8 --- /dev/null +++ b/source/config/initializers/content_security_policy.rb @@ -0,0 +1,26 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy +# For further information see the following documentation +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap and inline scripts +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src) +# +# # Report CSP violations to a specified URI. See: +# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# # config.content_security_policy_report_only = true +# end diff --git a/source/config/initializers/filter_parameter_logging.rb b/source/config/initializers/filter_parameter_logging.rb new file mode 100644 index 000000000..adc6568ce --- /dev/null +++ b/source/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/source/config/initializers/inflections.rb b/source/config/initializers/inflections.rb new file mode 100644 index 000000000..3860f659e --- /dev/null +++ b/source/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/source/config/initializers/permissions_policy.rb b/source/config/initializers/permissions_policy.rb new file mode 100644 index 000000000..00f64d71b --- /dev/null +++ b/source/config/initializers/permissions_policy.rb @@ -0,0 +1,11 @@ +# Define an application-wide HTTP permissions policy. For further +# information see https://developers.google.com/web/updates/2018/06/feature-policy +# +# Rails.application.config.permissions_policy do |f| +# f.camera :none +# f.gyroscope :none +# f.microphone :none +# f.usb :none +# f.fullscreen :self +# f.payment :self, "https://secure.example.com" +# end diff --git a/source/config/locales/en.yml b/source/config/locales/en.yml new file mode 100644 index 000000000..8ca56fc74 --- /dev/null +++ b/source/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# "true": "foo" +# +# To learn more, please read the Rails Internationalization guide +# available at https://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/source/config/master.key b/source/config/master.key new file mode 100644 index 000000000..b297d463f --- /dev/null +++ b/source/config/master.key @@ -0,0 +1 @@ +6379e3c58726a71cadb164aa40e5557a \ No newline at end of file diff --git a/source/config/puma.rb b/source/config/puma.rb new file mode 100644 index 000000000..daaf03699 --- /dev/null +++ b/source/config/puma.rb @@ -0,0 +1,43 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +# +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked web server processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/source/config/routes.rb b/source/config/routes.rb new file mode 100644 index 000000000..c44fccf14 --- /dev/null +++ b/source/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + root 'charges#index' +end diff --git a/source/config/storage.yml b/source/config/storage.yml new file mode 100644 index 000000000..4942ab669 --- /dev/null +++ b/source/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/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-<%= Rails.env %> + +# 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-<%= Rails.env %> + +# Use bin/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-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/source/config/tailwind.config.js b/source/config/tailwind.config.js new file mode 100644 index 000000000..094432ff5 --- /dev/null +++ b/source/config/tailwind.config.js @@ -0,0 +1,22 @@ +const defaultTheme = require('tailwindcss/defaultTheme') + +module.exports = { + content: [ + './public/*.html', + './app/helpers/**/*.rb', + './app/javascript/**/*.js', + './app/views/**/*.{erb,haml,html,slim}' + ], + theme: { + extend: { + fontFamily: { + sans: ['Inter var', ...defaultTheme.fontFamily.sans], + }, + }, + }, + plugins: [ + require('@tailwindcss/forms'), + require('@tailwindcss/aspect-ratio'), + require('@tailwindcss/typography'), + ] +} diff --git a/source/db/development.sqlite3 b/source/db/development.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..81cc37cee622f86b9ca3fd60f90fc8bc6d62c2e1 GIT binary patch literal 36864 zcmeI*e`pg|902gUBu$#6&Ff}elqx;bferr34^x{C#9K{WYny7?4!a@QnOxgjlS{o^ zY70Y_1jl4_!y$tW1UHIfWxCB#EgKGoQh$t2Wz0XU(~U83pqtyA2>Zd_YjaIf8(}1a zS-(e87Ean(KNMzVJM2y;fEeSl&uH{8s!W8 zna+rFg*s}re{m_gOBEY_q|g&+)Kp>mwRC;S4PyWozy<;!00JNY0w4eaAOHgYmB2u; z&g`k6<4XlG$PY|C`2#(i)Xhiz5z!xrMde7Cm;6F7RjRM|dDwOj)9Bsk*~VDzw}*vk z^)i;!eio+Ml9A0~O=@*Ib43NcCm?e>LVT)O>Qiy*RodAnn>|@MgrJ2HM49jAC1#7S zv4!<@GMhb}4BOG(+UUi*wRpVkjJFj(I+~kT;(gOYNbi|Z-^Y=ZJ0g(~&xyD_7mmb4 zd8X-921(+@z@UZc=OofWTqf~dF)Ws~XHbat#pLX=fW&jS$j{-7K^)0Kn6Iv}W_B>v zM=I{uq`uYL*6w2)@xUxyy?%)kLQ#L0JIK|zb_DD;i=m;_=V{#Jor0LfY+x9lr@`a% zck`1qsz&KMptKkG|f*0jv3tQNU2zY_0h zjXzVQGgns9N%i#9re+|jOhr_im1ky(lurG-3GNc4sO%>%o;g7wZjQnN%!W1IuGX1d zE;_M!YH%DrHt=$kL@wkH^D>9$lAEhclRf0Qnvf~!<~iT(C_iq!bqY%%#(TZ$hlbcI4c;V0NY z00ck)1V8`;KmY_l00ck)1V8`;9yozAmCEX{IUKfHo73)a*j=tNI!3m00ck)1V8`;KmY_l00ck)1Rhme>Fm>g)gx-FK3zo4|H=J-8ht?F z57K%0a%L4@LS&NY3n6 z*=kqWoQ&O3=Wx{7ovYWm-8HrAa@Uai|1|oA!XL1K00@8p2!H?xfB*=900@8p2!H?x z%ohQZx=NpM`GDO2*O)F-rpu@b9Y^AP877Pa1V8`;KmY_l00ck)1V8`;K;U5!sE;4| z^Ze6VYN45BTZCS|EiA}AnK#0nbq;%-!@0WFz1HT&?~+g7JkPH2B!d{h*aUxa> zO8l<+o|xF3dxzXL^~s4#KbLB$1&dkM$35S~g+(EnyLs-K`ozui$6{K_ypUy^B0b_@ zLnyKYG(d9g?se)5IO%Z*N;<%$BZ2%`%4og-&Hzy(TDTP2Sx(|AOHd&00JNY0uQP{Q*w0Vk8%U0Db_D7*0U`6$*yIvO_qdQ z_o-@}PS@Obg-A`)(6P7l1xy$Jd-$Wr)A?3?JQ>TYdx`O}3;0i0E5pq@U-H!hzZnad z?~TcQO{sLnEL(nU`K7#un>=#**7gGCOMLV76;(RlvZD)n^6FpwhqIsb7BJu88*jE1 zFx|wR*U4hm<71;Bv+?40w>s1L^41&sYv0Cny1WnF_=)())&k~B>^bm7Ljm(8C&sSt zPUp+}*!_KYZ@7Tz;x8S0ha9`9)slDj5}%En^cOH+^3H4Db{8%mdH;VoDx**{dKqm) zFQ7gYMElVNbOlwT>u4?7fKH*?XbC!q-bZ7&A#5N30w4eaAOHd&00JNY0w4eaATSRE zjB1UBT!N_?Ik8`f>BB>M5|e8Im1h?XD{=Lg)lMb0pB{XL#N=9^>e88WO69sH#r_zsEo1&sJGwFkWvpArx>DE=_MYZ6+NAr# zz}EJAX#D!#yYIdCdG7+3oThb0Q&1Kde?$uNGGn7kD4M3WFbqXeEdJKvZ)GdMfm-klqkhQzr zv8Wsg3)m?`Timrio>X*2A{bL-YF%|)d(-T=aU~y)#6&zS<91#qkS*qw76T_JY0jjjWPLqy%HY`MZJEfk9XL+x><`!U)SPs zHEea08OEyVWM)0XcwBWZkIP--YQ>YC;*6&F&3beEIknbURz@fDX6H_6G1oMI(flb5 z7SCYXI%Bx@ww4Ar-m%$*d#x-*JSG016qUUqA6~EqLwtt99N3u$HCm%<6&+s_#Pc{f z^WaS_KyO6!Dr3Z}D^;pa4Yt8u>)Oef?zM-BX>nuG*|knE(z2P%+f^Fl`t@|j3~IDL zgfB?FQK3JE7o4!@*SrP5iz+LK)dsw$8QG{(a+2+NV*VuCs@E8wx6{;2KT~`1F*!2Z z?@Z4VUN%#y4&9;1r7$(9)fzW#qT^+={q7D3Vcr`K_DH-OjEGTuPA@FbEaHxB()n8SQ;Pw#I`r7PgL(yQyHmNeYtu`@S2 zbC@sj?Kf9c^ZC{uUlv$W|KdNK`?NQQ`HuedPHPU+P2PTsEM^@(H*zu?FJHUaF`sYA zdgFiXuboe~#rLzIW_Ba_**9 z%aXg7_x8MA(CwKYC^*@b%rtlYRAOHd&00JNY0w4eaAOHd&00JNY0uO{h z37uD_R_?usl9!tFcwD8ZghEZ|RkRbmg!+&V9Y7b+6;y$)qbjrookq9NYIGQVh{kb4 z*gyaTKmY_l00ck)1V8`;KmY_l-~kXQ%u}n$b+KdQ`k@l7q zgB_%t^haA(e_Dx+hue23G4sAKL1NN3=dr5YN^JN*eM5;$Cigcg@w)TxURC0!Pu=Vx z@Bga}mnp+#RE|y{@d21Z7y<}@00@8p2!H?xfB*=900@A5C?)% zL<|d}EDKRNb9fpa TP+mEm_Ns)+kXNotd)?q4hSpN| literal 0 HcmV?d00001 diff --git a/source/lib/.DS_Store b/source/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..33ed7052cc9537667dd0ee5b5aef794d8762fe4c GIT binary patch literal 6148 zcmeHK!A`?447Im`I>BK_j`@ZDK{k~mT=oMnhCte?P8!_v4g3PX!dG$PIkw75i#UNM zWLM5h9Xm;1s=6j3UOcZ$q8SktP{Gj@&49?bXir9FkwMOLJkfspP%iJ9de`%I!!a@- zXLm}sw8wQ%!{^r-ubZk`ZJQP1ir1I(_v@>-`PVt>X8ohj?y>itoM3&~$!72^Iv73N z!@O+w(DC@(!LY}``p0-az9(nE8E^)Eg8}4hk>X6zTW7!-a0Xfi + 6: <%= charge.customer.full_name %> + 7: <%= charge.amount %> + 8: <%= charge.created_at.iso %> + 9: + 10: <% end %> + 11: + +app/views/charges/index.html.erb:8 +app/views/charges/index.html.erb:4 +Started GET "/" for ::1 at 2022-08-03 20:44:20 +0800 +Processing by ChargesController#index as HTML + Rendering layout layouts/application.html.erb + Rendering charges/index.html.erb within layouts/application + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 0]] + ↳ app/views/charges/index.html.erb:4 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 968210317], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Charge Load (0.2ms) SELECT "charges".* FROM "charges" WHERE "charges"."disputed" = ? [["disputed", 1]] + ↳ app/views/charges/index.html.erb:14 + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 1]] + ↳ app/views/charges/index.html.erb:18 + Rendered charges/index.html.erb within layouts/application (Duration: 16.7ms | Allocations: 8805) + Rendered layout layouts/application.html.erb (Duration: 25.3ms | Allocations: 16255) +Completed 200 OK in 28ms (Views: 26.1ms | ActiveRecord: 0.9ms | Allocations: 17296) + + +Started GET "/" for ::1 at 2022-08-03 20:44:26 +0800 +Processing by ChargesController#index as HTML + Rendering layout layouts/application.html.erb + Rendering charges/index.html.erb within layouts/application + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 0]] + ↳ app/views/charges/index.html.erb:4 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.2ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 968210317], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."disputed" = ? [["disputed", 1]] + ↳ app/views/charges/index.html.erb:14 + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 1]] + ↳ app/views/charges/index.html.erb:18 + Rendered charges/index.html.erb within layouts/application (Duration: 15.8ms | Allocations: 8816) + Rendered layout layouts/application.html.erb (Duration: 24.2ms | Allocations: 16032) +Completed 200 OK in 27ms (Views: 25.0ms | ActiveRecord: 0.9ms | Allocations: 17082) + + +Started GET "/" for ::1 at 2022-08-03 20:45:25 +0800 +Processing by ChargesController#index as HTML + Rendering layout layouts/application.html.erb + Rendering charges/index.html.erb within layouts/application + Charge Load (0.2ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 0]] + ↳ app/views/charges/index.html.erb:4 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Rendered charges/index.html.erb within layouts/application (Duration: 7.0ms | Allocations: 4055) + Rendered layout layouts/application.html.erb (Duration: 7.5ms | Allocations: 4129) +Completed 500 Internal Server Error in 11ms (ActiveRecord: 0.2ms | Allocations: 5148) + + + +ActionView::Template::Error (undefined method `date' for Wed, 03 Aug 2022 12:39:24.448557000 UTC +00:00:ActiveSupport::TimeWithZone): + 5:
  • + 6: <%= charge.customer.full_name %> + 7: <%= charge.amount %> + 8: <%= charge.created_at.date %> + 9:
  • + 10: <% end %> + 11: + +app/views/charges/index.html.erb:8 +app/views/charges/index.html.erb:4 +Started PUT "/__web_console/repl_sessions/f3c706db3f8151f7d8b0d2a3e49ac045" for ::1 at 2022-08-03 20:45:29 +0800 +Started PUT "/__web_console/repl_sessions/f3c706db3f8151f7d8b0d2a3e49ac045" for ::1 at 2022-08-03 20:45:29 +0800 +Started GET "/" for ::1 at 2022-08-03 20:45:51 +0800 +Processing by ChargesController#index as HTML + Rendering layout layouts/application.html.erb + Rendering charges/index.html.erb within layouts/application + Charge Load (0.2ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 0]] + ↳ app/views/charges/index.html.erb:4 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.2ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 968210317], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Charge Load (0.2ms) SELECT "charges".* FROM "charges" WHERE "charges"."disputed" = ? [["disputed", 1]] + ↳ app/views/charges/index.html.erb:14 + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 1]] + ↳ app/views/charges/index.html.erb:18 + Rendered charges/index.html.erb within layouts/application (Duration: 17.2ms | Allocations: 8838) + Rendered layout layouts/application.html.erb (Duration: 27.7ms | Allocations: 16286) +Completed 200 OK in 31ms (Views: 28.5ms | ActiveRecord: 1.1ms | Allocations: 17326) + + +Started GET "/" for ::1 at 2022-08-03 20:46:39 +0800 +Processing by ChargesController#index as HTML + Rendering layout layouts/application.html.erb + Rendering charges/index.html.erb within layouts/application + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."paid" = ? [["paid", 0]] + ↳ app/views/charges/index.html.erb:4 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 565318504], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Customer Load (0.1ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 968210317], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 350169046], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:6 + Charge Load (0.1ms) SELECT "charges".* FROM "charges" WHERE "charges"."disputed" = ? [["disputed", 1]] + ↳ app/views/charges/index.html.erb:15 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:17 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 766761845], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:17 + CACHE Customer Load (0.0ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = ? LIMIT ? [["id", 968210317], ["LIMIT", 1]] + ↳ app/views/charges/index.html.erb:17 + Rendered charges/index.html.erb within layouts/application (Duration: 19.4ms | Allocations: 10673) + Rendered layout layouts/application.html.erb (Duration: 19.6ms | Allocations: 10747) +Completed 500 Internal Server Error in 23ms (ActiveRecord: 0.8ms | Allocations: 11762) + + + +ActionView::Template::Error (undefined method `each' for nil:NilClass): + 23: + 24:

    Successful Charges

    + 25: