From 264cb58a3f45b87f64473e4387ceec987807a2b2 Mon Sep 17 00:00:00 2001 From: abdulhamiid Date: Sun, 7 Jan 2024 15:26:44 +0100 Subject: [PATCH 1/6] Deploy app to render --- Gemfile | 6 +- Gemfile.lock | 340 +++++++++++++++++++++++--------------------- bin/render-build.sh | 7 + config/database.yml | 6 +- render.yaml | 23 +++ 5 files changed, 213 insertions(+), 169 deletions(-) create mode 100644 bin/render-build.sh create mode 100644 render.yaml diff --git a/Gemfile b/Gemfile index b48d18c..5a9cdbc 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,9 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rubocop', '>= 1.0', '< 2.0' -ruby '3.1.2' +ruby '3.2.2' + +gem 'sass-rails', '>= 5.0.3' gem 'cancancan' @@ -90,3 +92,5 @@ group :test do end gem 'active_model_serializers', '~> 0.10.13' + +gem 'psych', '~> 3.3', '>= 3.3.0' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 577cbfb..4a73158 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,98 +1,97 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_serializers (0.10.13) - actionpack (>= 4.1, < 7.1) - activemodel (>= 4.1, < 7.1) + active_model_serializers (0.10.14) + actionpack (>= 4.1) + activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.4) - activesupport (= 7.0.4) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.1) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - autoprefixer-rails (10.4.7.0) + autoprefixer-rails (10.4.16.0) execjs (~> 2) - bcrypt (3.1.18) + bcrypt (3.1.20) bindex (0.8.1) - bootsnap (1.13.0) + bootsnap (1.17.0) msgpack (~> 1.2) - bootstrap (5.2.1) + bootstrap (5.3.2) autoprefixer-rails (>= 9.1.0) - popper_js (>= 2.11.6, < 3) - sassc-rails (>= 2.0.0) - bootstrap_form (5.1.0) - actionpack (>= 5.2) - activemodel (>= 5.2) + popper_js (>= 2.11.8, < 3) + bootstrap_form (5.4.0) + actionpack (>= 6.1) + activemodel (>= 6.1) builder (3.2.4) - bullet (7.0.3) + bullet (7.1.4) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) - cancancan (3.4.0) - capybara (3.37.1) + cancancan (3.5.0) + capybara (3.39.2) addressable matrix mini_mime (>= 0.1.3) @@ -103,150 +102,160 @@ GEM xpath (~> 3.2) case_transform (0.2) activesupport - childprocess (4.1.0) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) crass (1.0.6) - devise (4.8.1) + date (3.3.4) + devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) diff-lcs (1.5.0) - digest (3.1.0) - erubi (1.11.0) - execjs (2.8.1) - ffi (1.15.5) - globalid (1.0.0) - activesupport (>= 5.0) - i18n (1.12.0) + erubi (1.12.0) + execjs (2.9.1) + ffi (1.16.3) + ffi (1.16.3-x64-mingw-ucrt) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) concurrent-ruby (~> 1.0) - importmap-rails (1.1.5) + importmap-rails (1.2.3) actionpack (>= 6.0.0) + activesupport (>= 6.0.0) railties (>= 6.0.0) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) - jquery-rails (4.5.0) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.6.2) + json (2.7.1) jsonapi-renderer (0.2.2) - jwt (2.5.0) - launchy (2.5.0) - addressable (~> 2.7) + jwt (2.7.1) + language_server-protocol (3.17.0.3) + launchy (2.5.2) + addressable (~> 2.8) letter_opener (1.8.1) launchy (>= 2.2, < 3) - loofah (2.19.0) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) matrix (0.4.2) method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.16.3) - msgpack (1.5.6) - net-imap (0.2.3) - digest + mini_mime (1.1.5) + minitest (5.20.0) + msgpack (1.7.2) + net-imap (0.4.8) + date net-protocol - strscan - net-pop (0.1.1) - digest + net-pop (0.1.2) net-protocol + net-protocol (0.2.2) timeout - net-protocol (0.1.3) - timeout - net-smtp (0.3.1) - digest + net-smtp (0.4.0) net-protocol - timeout - nio4r (2.5.8) - nokogiri (1.13.8-x86_64-linux) + nio4r (2.7.0) + nokogiri (1.15.5-x64-mingw-ucrt) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) - parallel (1.22.1) - parser (3.1.2.1) + parallel (1.24.0) + parser (3.2.2.4) ast (~> 2.4.1) - pg (1.4.3) - popper_js (2.11.6) - public_suffix (5.0.0) - puma (5.6.5) + racc + pg (1.5.4) + pg (1.5.4-x64-mingw-ucrt) + popper_js (2.11.8) + psych (3.3.4) + public_suffix (5.0.4) + puma (5.6.7) nio4r (~> 2.0) - racc (1.6.0) - rack (2.2.4) - rack-test (2.0.2) + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.4) + railties (= 7.0.8) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.5.0) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) - rexml (3.2.5) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-rails (5.1.2) + rake (13.1.0) + regexp_parser (2.8.3) + responders (3.1.1) actionpack (>= 5.2) - activesupport (>= 5.2) railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.11.1) - rubocop (1.36.0) + rexml (3.2.6) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-rails (6.1.0) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.1) + rubocop (1.59.0) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.20.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.21.0) - parser (>= 3.1.1.0) - ruby-progressbar (1.11.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + ruby-progressbar (1.13.0) rubyzip (2.3.2) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) @@ -255,54 +264,55 @@ GEM sprockets (> 3.0) sprockets-rails tilt - selenium-webdriver (4.4.0) - childprocess (>= 0.5, < 5.0) + selenium-webdriver (4.16.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - shoulda-matchers (5.2.0) + shoulda-matchers (5.3.0) activesupport (>= 5.2.0) - sprockets (4.1.1) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - stimulus-rails (1.1.0) + stimulus-rails (1.3.0) railties (>= 6.0.0) - strscan (3.0.4) - thor (1.2.1) - tilt (2.0.11) - timeout (0.3.0) - turbo-rails (1.3.0) + thor (1.3.0) + tilt (2.3.0) + timeout (0.4.1) + turbo-rails (1.5.0) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) + tzinfo-data (1.2023.3) + tzinfo (>= 1.0.0) + unicode-display_width (2.5.0) uniform_notifier (1.16.0) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webdrivers (5.1.0) + webdrivers (5.2.0) nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0) - websocket (1.2.9) - websocket-driver (0.7.5) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.0) + zeitwerk (2.6.12) PLATFORMS + x64-mingw-ucrt x86_64-linux DEPENDENCIES @@ -320,11 +330,13 @@ DEPENDENCIES jwt letter_opener pg (~> 1.1) + psych (~> 3.3, >= 3.3.0) puma (~> 5.0) rails (~> 7.0.4) rails-controller-testing rspec-rails (>= 3.9.0) rubocop (>= 1.0, < 2.0) + sass-rails (>= 5.0.3) selenium-webdriver shoulda-matchers (~> 5.0) sprockets-rails @@ -335,7 +347,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 3.1.2p20 + ruby 3.2.2p53 BUNDLED WITH 2.3.22 diff --git a/bin/render-build.sh b/bin/render-build.sh new file mode 100644 index 0000000..e8834c4 --- /dev/null +++ b/bin/render-build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# exit on error +set -o errexit + +bundle install +./bin/rails assets:precompile +./bin/rails assets:clean \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index 06f56db..84d8691 100644 --- a/config/database.yml +++ b/config/database.yml @@ -24,8 +24,7 @@ default: &default development: <<: *default database: blog_app_development - host: localhost - username: hamid + username: postgres password: hamid # The specified database role being used to connect to postgres. @@ -61,8 +60,7 @@ development: test: <<: *default database: blog_app_test - host: localhost - username: hamid + username: postgres password: hamid # As with config/credentials.yml, you never want to store sensitive information, diff --git a/render.yaml b/render.yaml new file mode 100644 index 0000000..edf80a2 --- /dev/null +++ b/render.yaml @@ -0,0 +1,23 @@ +databases: + - name: mysite + databaseName: mysite + user: mysite + plan: free + +services: + - type: web + name: mysite + runtime: ruby + plan: free + buildCommand: "./bin/render-build.sh" + # preDeployCommand: "./bin/rails db:migrate" # preDeployCommand only available on paid instance types + startCommand: "./bin/rails server" + envVars: + - key: DATABASE_URL + fromDatabase: + name: mysite + property: connectionString + - key: RAILS_MASTER_KEY + sync: false + - key: WEB_CONCURRENCY + value: 2 # sensible default \ No newline at end of file From 9d77129f5a8023736cbaee680e1206a7d1bd263c Mon Sep 17 00:00:00 2001 From: abdulhamiid Date: Sun, 7 Jan 2024 15:39:48 +0100 Subject: [PATCH 2/6] Modify ruby version --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5a9cdbc..a42bdb8 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rubocop', '>= 1.0', '< 2.0' -ruby '3.2.2' +ruby '3.1.2' gem 'sass-rails', '>= 5.0.3' From 051dcaf8123e15bcc6141408627b8c97cd552794 Mon Sep 17 00:00:00 2001 From: abdulhamiid Date: Sun, 7 Jan 2024 15:52:56 +0100 Subject: [PATCH 3/6] Update master key --- Gemfile | 2 +- config/credentials.yml.enc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index a42bdb8..5a9cdbc 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rubocop', '>= 1.0', '< 2.0' -ruby '3.1.2' +ruby '3.2.2' gem 'sass-rails', '>= 5.0.3' diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index 68b3d24..ed6c272 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -YGE9nzPR1Emwc0zZgQbC0g0Xo++SeAn1tCR3unVXA0J2SFnF79CEGyfyAg0S+f9jFWKiRz+DU/cvyO5in7z8Uc9N7NwolURO7S9bYXWQ8pp6s0TAq3DlNcbFRXC+ggItkqPU773bMC9YopGlH5B6G9dveFAR7ULjYETMOzfYYH5MZAx1XF59lvAD2YDVTlLji3siL9psyelAZF7YPEayeVT1ZbnoAnRiZsD0sNta9HGVjqPEzw3u3ubJ6kBQ5kIFX7YMCq4q8NV131Tzv6IRq5XR4JvebU0qJ9vMBYFLaQtCQAhDk5yAOJldumAWMcadrmdWX3eP3GYYkOXPOeP9hw9lacoV6oMFXxnLdLY74QsEaJ0JmjdfjQcviecKQTFCS8ib3LAY9ceoerlww0QgF26r3UcZVq6kw9Hf--onVdoWyrSEwHZ2tl--8IF/q1D/FqOXmShTrbM7fw== \ No newline at end of file +fZJBl7a528fR1BWykT8AM3LD18ZKA1FtrIg9KuYw/KcDFKAjmff3dsorD+vfVVtUY+cNyl3Sl0XJJC0duImB8O6apOTCPnsuDiXPQXL/aeHMCrsKdZ02DVJj1TvCCNMAHN+O0awJWyjzM6mRrcMtnrWY+dUmwm1qp1Zu6S84NjSTtdAQoYeTCTjt6kTiLx2S5xIfAdXUU8tU27LlGPxzSvb0iOCh5Ha9tj7qVUGYlyZ3cdYBIyNKmKn1aUKY0ja3J7rAE6GpNrjHPuo0wxcGWFJI18pgAZ8ZJjUU+3pS406oxz2FFLmuxOhCjpK09DvfxHHM8du6rOZdGLJkHf9fHc48ebkkhNKrz60+RnQoEjvgBoZJ8QqyMTOgzTMCajmZwy7t2KvDbnhRunK6/qj1eHWtO0Sm1W0cUxHS--zL1yMu6ZxRNxnpWq--1mQb7olLAvAxI7nqcs0X+g== \ No newline at end of file From 18033c372bbe27e4ea3feb9f73f879409aac6f10 Mon Sep 17 00:00:00 2001 From: abdulhamiid Date: Sun, 7 Jan 2024 15:53:24 +0100 Subject: [PATCH 4/6] Modify ruby version --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5a9cdbc..a42bdb8 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rubocop', '>= 1.0', '< 2.0' -ruby '3.2.2' +ruby '3.1.2' gem 'sass-rails', '>= 5.0.3' From 65cde4cc44eaae4bb4c234b2eefcc886497e6cb9 Mon Sep 17 00:00:00 2001 From: abdulhamiid Date: Sun, 7 Jan 2024 17:36:15 +0100 Subject: [PATCH 5/6] Modify production url --- config/environments/production.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index a5e563c..3568ef4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -49,6 +49,7 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true + config.action_mailer.default_url_options = { host: 'https://blog-app-8pi0.onrender.com/' } # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). From b261eb3bc9ff708d0c33110276c70b1bbc96c77d Mon Sep 17 00:00:00 2001 From: abdulhamiid Date: Sun, 7 Jan 2024 17:45:48 +0100 Subject: [PATCH 6/6] Remove confirmable from devise --- app/models/user.rb | 3 +-- db/migrate/20221007101943_add_devise_to_users.rb | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 9be66d3..84b4255 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -4,8 +4,7 @@ class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :validatable, - :confirmable + :recoverable, :rememberable, :validatable has_many :posts, foreign_key: 'author_id' has_many :comments, foreign_key: 'author_id' has_many :likes, foreign_key: 'author_id' diff --git a/db/migrate/20221007101943_add_devise_to_users.rb b/db/migrate/20221007101943_add_devise_to_users.rb index d143713..98ed9dc 100644 --- a/db/migrate/20221007101943_add_devise_to_users.rb +++ b/db/migrate/20221007101943_add_devise_to_users.rb @@ -22,10 +22,10 @@ def self.up # t.string :last_sign_in_ip ## Confirmable - t.string :confirmation_token - t.datetime :confirmed_at - t.datetime :confirmation_sent_at - t.string :unconfirmed_email # Only if using reconfirmable + # t.string :confirmation_token + # t.datetime :confirmed_at + # t.datetime :confirmation_sent_at + # t.string :unconfirmed_email # Only if using reconfirmable ## Lockable # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts