diff --git a/.gitignore b/.gitignore index 0dd0f24..1953ae7 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,5 @@ bower.json # environment variables .env + +/config/credentials/production.key diff --git a/.ruby-version b/.ruby-version index 49cdd66..fd2a018 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.6 +3.1.0 diff --git a/Gemfile b/Gemfile index 7d9a61c..6eece76 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,9 @@ git_source(:github) do |repo_name| "https://github.com/#{repo_name}.git" end -ruby '2.7.6' +# Upgrade ruby from 2.7.6 to 3.1.0 for Render deployment +# ruby '2.7.6' +ruby '3.1.0' # Required gems for Heroku deployment gem 'rails_12factor', group: :production @@ -39,11 +41,16 @@ gem 'dotenv-rails', groups: [:development, :test] # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # gem 'rails', '~> 5.0.7' # working as of 5/30/2022 -gem 'rails', '~> 5.2.7' + +# 'rails', '~> 5.2.7' is not working in Ruby 3.1.0 +# gem 'rails', '~> 5.2.7' +gem 'rails', '~> 7.2.0' # Note: Heroku dont support sqlite3 so lets comment it out and use postgres # gem 'sqlite3' -gem 'pg', '~> 0.21.0' + +# Note: Netlify dont support pg so lets comment it out and use neon db +gem 'pg' # gem 'mysql2', '~> 0.3.20' diff --git a/Gemfile.lock b/Gemfile.lock index f6c3a96..86d8ce5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,55 +1,88 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.8) - actionpack (= 5.2.8) + actioncable (7.2.2.2) + actionpack (= 7.2.2.2) + activesupport (= 7.2.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.8) - actionpack (= 5.2.8) - actionview (= 5.2.8) - activejob (= 5.2.8) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.8) - actionview (= 5.2.8) - activesupport (= 5.2.8) - rack (~> 2.0, >= 2.0.8) + zeitwerk (~> 2.6) + actionmailbox (7.2.2.2) + actionpack (= 7.2.2.2) + activejob (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + mail (>= 2.8.0) + actionmailer (7.2.2.2) + actionpack (= 7.2.2.2) + actionview (= 7.2.2.2) + activejob (= 7.2.2.2) + activesupport (= 7.2.2.2) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.2.2) + actionview (= 7.2.2.2) + activesupport (= 7.2.2.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.2) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.8) - activesupport (= 5.2.8) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.2.2) + actionpack (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.2.2.2) + activesupport (= 7.2.2.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.8) - activesupport (= 5.2.8) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.2.2) + activesupport (= 7.2.2.2) globalid (>= 0.3.6) - activemodel (5.2.8) - activesupport (= 5.2.8) - activerecord (5.2.8) - activemodel (= 5.2.8) - activesupport (= 5.2.8) - arel (>= 9.0) - activestorage (5.2.8) - actionpack (= 5.2.8) - activerecord (= 5.2.8) - marcel (~> 1.0.0) - activesupport (5.2.8) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - arel (9.0.0) - bcrypt (3.1.18) + activemodel (7.2.2.2) + activesupport (= 7.2.2.2) + activerecord (7.2.2.2) + activemodel (= 7.2.2.2) + activesupport (= 7.2.2.2) + timeout (>= 0.4.0) + activestorage (7.2.2.2) + actionpack (= 7.2.2.2) + activejob (= 7.2.2.2) + activerecord (= 7.2.2.2) + activesupport (= 7.2.2.2) + marcel (~> 1.0) + activesupport (7.2.2.2) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.3.0) + bcrypt (3.1.20) + benchmark (0.4.1) + bigdecimal (3.3.1) bindex (0.8.1) - buftok (0.2.0) - builder (3.2.4) - byebug (11.1.3) + buftok (0.3.0) + builder (3.3.0) + byebug (12.0.0) + cgi (0.5.0) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) @@ -57,96 +90,134 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.10) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) crass (1.0.6) - devise (4.8.1) + date (3.4.1) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.6) - dotenv-rails (2.7.6) - dotenv (= 2.7.6) - railties (>= 3.2) + domain_name (0.6.20240107) + dotenv (3.1.8) + dotenv-rails (3.1.8) + dotenv (= 3.1.8) + railties (>= 6.1) + drb (2.2.3) equalizer (0.0.11) - erubi (1.10.0) - execjs (2.8.1) - faraday (2.3.0) - faraday-net_http (~> 2.0) - ruby2_keywords (>= 0.0.4) - faraday-net_http (2.0.3) - ffi (1.15.5) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) + erb (4.0.4) + cgi (>= 0.3.3) + erubi (1.13.1) + execjs (2.10.0) + faraday (2.14.0) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.1) + net-http (>= 0.5.0) + ffi (1.17.2) + ffi-compiler (1.3.2) + ffi (>= 1.15.5) rake - globalid (1.0.0) - activesupport (>= 5.0) - haml (5.2.2) - temple (>= 0.8.0) + globalid (1.3.0) + activesupport (>= 6.1) + haml (6.3.0) + temple (>= 0.8.2) + thor tilt hashie (3.6.0) - http (4.4.1) - addressable (~> 2.3) + http (5.3.0) + addressable (~> 2.8) http-cookie (~> 1.0) http-form_data (~> 2.2) - http-parser (~> 1.2.0) - http-cookie (1.0.5) + llhttp (~> 0.5.0) + http-cookie (1.1.0) domain_name (~> 0.5) http-form_data (2.3.0) - http-parser (1.2.3) - ffi-compiler (>= 1.0, < 2.0) - http_parser.rb (0.6.0) - i18n (1.10.0) + i18n (1.14.7) concurrent-ruby (~> 1.0) - jbuilder (2.11.5) - actionview (>= 5.0.0) - activesupport (>= 5.0.0) - jquery-rails (4.5.0) + io-console (0.8.1) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.14.1) + actionview (>= 7.0.0) + activesupport (>= 7.0.0) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-turbolinks (2.1.0) railties (>= 3.1.0) turbolinks - jwt (2.3.0) + json (2.15.1) + jwt (2.10.2) + base64 linkedin (1.1.1) hashie (~> 3.0) multi_json (~> 1.0) oauth2 (~> 1.0) - loofah (2.18.0) + llhttp (0.5.0) + llhttp-ffi (0.4.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) + logger (1.7.0) + loofah (2.24.1) 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) - marcel (1.0.2) + net-imap + net-pop + net-smtp + marcel (1.1.0) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) - method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.15.0) - multi_json (1.15.0) + mini_mime (1.1.5) + mini_portile2 (2.8.9) + minitest (5.26.0) + multi_json (1.17.0) multi_xml (0.6.0) - multipart-post (2.1.1) + multipart-post (2.4.1) naught (1.1.0) - nio4r (2.5.8) - nokogiri (1.13.6-x86_64-linux) + net-http (0.6.0) + uri + net-imap (0.5.12) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.4) + nokogiri (1.18.10) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - oauth (0.5.10) - oauth2 (1.4.9) + oauth (1.1.2) + oauth-tty (~> 1.0, >= 1.0.6) + snaky_hash (~> 2.0) + version_gem (~> 1.1, >= 1.1.9) + oauth-tty (1.0.6) + version_gem (~> 1.1, >= 1.1.9) + oauth2 (1.4.11) faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) multi_json (~> 1.3) multi_xml (~> 0.5) - rack (>= 1.2, < 3) - omniauth (2.1.0) + rack (>= 1.2, < 4) + omniauth (2.1.4) hashie (>= 3.4.6) + logger rack (>= 2.2.3) rack-protection - omniauth-facebook (9.0.0) - omniauth-oauth2 (~> 1.2) + omniauth-facebook (10.0.0) + bigdecimal + omniauth-oauth2 (>= 1.2, < 3) omniauth-github (2.0.0) omniauth (~> 2.0) omniauth-oauth2 (~> 1.7.1) @@ -155,65 +226,88 @@ GEM oauth2 (~> 1.1) omniauth (~> 2.0) omniauth-oauth2 (~> 1.7.1) - omniauth-linkedin-oauth2 (1.0.0) + omniauth-linkedin-oauth2 (1.0.1) omniauth-oauth2 - omniauth-oauth (1.2.0) + omniauth-oauth (1.2.1) oauth omniauth (>= 1.0, < 3) - omniauth-oauth2 (1.7.2) - oauth2 (~> 1.4) + rack (>= 1.6.2, < 4) + omniauth-oauth2 (1.7.3) + oauth2 (>= 1.4, < 3) omniauth (>= 1.9, < 3) omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) rack orm_adapter (0.5.0) - pg (0.21.0) - public_suffix (4.0.7) + pg (1.6.2-x86_64-linux) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + psych (5.2.6) + date + stringio + public_suffix (6.0.2) puma (4.3.12) nio4r (~> 2.0) - racc (1.6.0) - rack (2.2.3.1) - rack-protection (2.2.0) - rack - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.8) - actioncable (= 5.2.8) - actionmailer (= 5.2.8) - actionpack (= 5.2.8) - actionview (= 5.2.8) - activejob (= 5.2.8) - activemodel (= 5.2.8) - activerecord (= 5.2.8) - activestorage (= 5.2.8) - activesupport (= 5.2.8) - bundler (>= 1.3.0) - railties (= 5.2.8) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + racc (1.8.1) + rack (2.2.20) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-session (1.0.2) + rack (< 3) + rack-test (2.2.0) + rack (>= 1.3) + rackup (1.0.1) + rack (< 3) + webrick + rails (7.2.2.2) + actioncable (= 7.2.2.2) + actionmailbox (= 7.2.2.2) + actionmailer (= 7.2.2.2) + actionpack (= 7.2.2.2) + actiontext (= 7.2.2.2) + actionview (= 7.2.2.2) + activejob (= 7.2.2.2) + activemodel (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + bundler (>= 1.15.0) + railties (= 7.2.2.2) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (5.2.8) - actionpack (= 5.2.8) - activesupport (= 5.2.8) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rake (13.0.6) - rb-fsevent (0.11.1) - rb-inotify (0.10.1) + railties (7.2.2.2) + actionpack (= 7.2.2.2) + activesupport (= 7.2.2.2) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.3.0) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) ffi (~> 1.0) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) - ruby2_keywords (0.0.5) + rdoc (6.15.0) + erb + psych (>= 4.0.0) + tsort + reline (0.6.2) + io-console (~> 0.5) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -225,51 +319,63 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + securerandom (0.4.1) simple_oauth (0.3.1) - sprockets (3.7.2) + snaky_hash (2.0.3) + hashie (>= 0.1.0, < 6) + version_gem (>= 1.1.8, < 3) + sprockets (3.7.5) + base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - temple (0.8.2) - thor (1.2.1) + stringio (3.1.7) + temple (0.10.4) + thor (1.4.0) thread_safe (0.3.6) - tilt (2.0.10) + tilt (2.6.1) + timeout (0.4.3) + tsort (0.2.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - twitter (7.0.0) + twitter (8.0.1) addressable (~> 2.3) - buftok (~> 0.2.0) + buftok (~> 0.3.0) equalizer (~> 0.0.11) - http (~> 4.0) - http-form_data (~> 2.0) - http_parser.rb (~> 0.6.0) + http (~> 5.1) + http-form_data (~> 2.3) + llhttp-ffi (~> 0.4.0) memoizable (~> 0.4.0) multipart-post (~> 2.0) naught (~> 1.0) simple_oauth (~> 0.3.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) - uglifier (4.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uglifier (4.2.1) execjs (>= 0.3.0, < 3) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) + uri (1.0.4) + useragent (0.16.11) + version_gem (1.1.9) warden (1.2.9) rack (>= 2.0.9) - web-console (3.7.0) - actionview (>= 5.0) - activemodel (>= 5.0) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) bindex (>= 0.4.0) - railties (>= 5.0) - websocket-driver (0.7.5) + railties (>= 6.0.0) + webrick (1.9.1) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) + zeitwerk (2.6.18) PLATFORMS + ruby x86_64-linux DEPENDENCIES @@ -289,9 +395,9 @@ DEPENDENCIES omniauth-linkedin-oauth2 omniauth-oauth2 omniauth-twitter - pg (~> 0.21.0) + pg puma (~> 4.3) - rails (~> 5.2.7) + rails (~> 7.2.0) rails_12factor sass-rails (~> 5.0) turbolinks (~> 5) @@ -301,7 +407,7 @@ DEPENDENCIES web-console (>= 3.3.0) RUBY VERSION - ruby 2.7.6p219 + ruby 3.1.0p0 BUNDLED WITH 2.3.14 diff --git a/app/controllers/article_controller.rb b/app/controllers/article_controller.rb index 5b9be01..1f3e2a2 100644 --- a/app/controllers/article_controller.rb +++ b/app/controllers/article_controller.rb @@ -18,8 +18,8 @@ def edit end def save - # @article = Article.create(title: params[:article][:title], body: params[:article][:body]) - @article = Article.create(params[:article]) + # @article = Article.create(params[:article]) # not working + @article = Article.create(article_params) respond_to do |format| if @article.save format.html { redirect_to url_for(:action => "add", :controller => "article"), alert: 'Successfully saved.' } diff --git a/app/controllers/privacy_policy_controller.rb b/app/controllers/privacy_policy_controller.rb new file mode 100644 index 0000000..0971201 --- /dev/null +++ b/app/controllers/privacy_policy_controller.rb @@ -0,0 +1,9 @@ +class PrivacyPolicyController < ApplicationController + def index + @message = "Welcome to my Blog" + @articles = Article.all + respond_to do |format| + format.html + end + end +end diff --git a/app/controllers/terms_of_use_controller.rb b/app/controllers/terms_of_use_controller.rb new file mode 100644 index 0000000..5400356 --- /dev/null +++ b/app/controllers/terms_of_use_controller.rb @@ -0,0 +1,9 @@ +class TermsOfUseController < ApplicationController + def index + @message = "Welcome to my Blog" + @articles = Article.all + respond_to do |format| + format.html + end + end +end diff --git a/app/helpers/privacy_policy_helper.rb b/app/helpers/privacy_policy_helper.rb new file mode 100644 index 0000000..e10fd15 --- /dev/null +++ b/app/helpers/privacy_policy_helper.rb @@ -0,0 +1,2 @@ +module PrivacyPolicyHelper +end diff --git a/app/helpers/terms_of_use_helper.rb b/app/helpers/terms_of_use_helper.rb new file mode 100644 index 0000000..8d781ee --- /dev/null +++ b/app/helpers/terms_of_use_helper.rb @@ -0,0 +1,2 @@ +module TermsOfUseHelper +end diff --git a/app/views/privacy_policy/index.html.haml b/app/views/privacy_policy/index.html.haml new file mode 100644 index 0000000..2bd977e --- /dev/null +++ b/app/views/privacy_policy/index.html.haml @@ -0,0 +1,2 @@ +.wrapper + %p This is a sample policy privacy page \ No newline at end of file diff --git a/app/views/terms_of_use/index.html.haml b/app/views/terms_of_use/index.html.haml new file mode 100644 index 0000000..e0384a5 --- /dev/null +++ b/app/views/terms_of_use/index.html.haml @@ -0,0 +1,2 @@ +.wrapper + %p This is a sample terms of use page \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index b9775a1..1fa51b2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,7 +15,8 @@ # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -Dotenv::Railtie.load +# Dotenv::Railtie.load +Dotenv::Railtie.load unless Rails.env.production? module Blog class Application < Rails::Application diff --git a/config/credentials/production.yml.enc b/config/credentials/production.yml.enc new file mode 100644 index 0000000..b7c6b18 --- /dev/null +++ b/config/credentials/production.yml.enc @@ -0,0 +1 @@ +JBlX8mOGrLsKBHQnitBCQZw2QHA9cEXKoZgobZdt0Coww2OlcYeyrQGbYuljGkrqP/rOSEMZEaNbdWNIxFpoYgatLQi90EupURDlebB6AlD7YeCqv5rZ14dKJySvd/JZOlXcIDhqZJfcx3nlSV1fuJeoE9PWMOGZVFlXAZf7YKR6zp7xXcDS3rnrRdggbK0p44WH7HBtXfFR0gkgxnVNAFCu48830M0+YoG50vXUfiX0cpCH2LxjEpyRggVOtGJTWAd/FLfZ7EnNmEBSLh65srSzK3PROKbZfau9btObDqJEXZfFo8+WTMjZt0l2Dlg6dGi6+ribliwhHx7mjid5WJY+H8xaCPnlVz0qJrKwT2xv256P+cDtNWJPM+sTB3kZKxELR1r/yNkk2w0asbQNkBUiMBDR--MroyK2pBg1yUmjLY--gJ7eJpcwyx+jfoo4GPhXjg== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index 2640051..9c48be8 100644 --- a/config/database.yml +++ b/config/database.yml @@ -19,7 +19,9 @@ default: &default development: <<: *default - database: rorblog_development + # url: 'postgresql://neondb_owner:abc_DEF9caw8WXYZ@ep-fancy-dream-ab5abcdefg-pooler.c-2.us-east-2.aws.neon.tech/neondb?sslmode=require&channel_binding=require' + # database: rorblog_development + url: <%= ENV['DATABASE_URL'] %> # development: # adapter: mysql2 diff --git a/config/environments/development.rb b/config/environments/development.rb index 3223210..f8b6e72 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -36,6 +36,11 @@ # config.action_view.raise_on_missing_translations = true config.action_mailer.default_url_options = { host: 'localhost', port: 3001 } + config.assets.configure do |env| + env.js_compressor = :uglifier # or :closure, :yui + env.css_compressor = :sass # or :yui + end + # reload every changes # config.reload_classes_only_on_change = false end diff --git a/config/environments/production.rb b/config/environments/production.rb index a8836c3..37ff48a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -23,11 +23,17 @@ config.serve_static_assets = false # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier + # config.assets.js_compressor = :uglifier + # config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.configure do |env| + env.js_compressor = :uglifier # or :closure, :yui + env.css_compressor = :sass # or :yui + end + # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false + config.assets.compile = true # Generate digests for assets URLs. config.assets.digest = true @@ -79,4 +85,6 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + config.active_storage.service = :local end diff --git a/config/routes.rb b/config/routes.rb index 972e6b5..d16a72e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -22,6 +22,10 @@ get 'article/delete' get 'welcome/index' + get '/privacy-policy' => 'privacy_policy#index', :as => 'privacy_policy' + get '/terms-of-use' => 'terms_of_use#index', :as => 'terms_of_use' + + root 'welcome#index' # The priority is based upon order of creation: first created -> highest priority. diff --git a/config/secrets.yml b/config/secrets.yml index d9121b9..0fdd9e7 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -10,6 +10,8 @@ # Make sure the secrets in this file are kept private # if you're sharing your code publicly. +secret_key_base: ca1c54167b460f4c42c450b2a8f9aef0fb8caaa2b54fc41564e7bf63f841b0048b90d31165a7755888a97a78fe34d56c950a1e2906bf9475d8b5a7b47988470a + development: secret_key_base: ca1c54167b460f4c42c450b2a8f9aef0fb8caaa2b54fc41564e7bf63f841b0048b90d31165a7755888a97a78fe34d56c950a1e2906bf9475d8b5a7b47988470a diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 0000000..46a292f --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,16 @@ +# config/storage.yml +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Example for cloud storage (e.g., Amazon S3) +# amazon: +# service: S3 +# access_key_id: <%= ENV["AWS_ACCESS_KEY_ID"] %> +# secret_access_key: <%= ENV["AWS_SECRET_ACCESS_KEY"] %> +# region: us-east-1 +# bucket: your-bucket-name \ No newline at end of file diff --git a/db/migrate/20140705184622_create_articles.rb b/db/migrate/20140705184622_create_articles.rb index ad05f79..79d1022 100644 --- a/db/migrate/20140705184622_create_articles.rb +++ b/db/migrate/20140705184622_create_articles.rb @@ -1,5 +1,5 @@ - class CreateArticles < ActiveRecord::Migration + class CreateArticles < ActiveRecord::Migration[5.2] def change create_table :articles do |t| t.string :title diff --git a/db/migrate/20150326143007_create_users.rb b/db/migrate/20150326143007_create_users.rb index b8dcbdc..a113fb4 100644 --- a/db/migrate/20150326143007_create_users.rb +++ b/db/migrate/20150326143007_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration +class CreateUsers < ActiveRecord::Migration[5.2] def change create_table :users do |t| t.string :provider, null: false diff --git a/db/migrate/20150830155357_create_user_logins.rb b/db/migrate/20150830155357_create_user_logins.rb index f4524a4..bdf5b2d 100644 --- a/db/migrate/20150830155357_create_user_logins.rb +++ b/db/migrate/20150830155357_create_user_logins.rb @@ -1,4 +1,4 @@ -class CreateUserLogins < ActiveRecord::Migration +class CreateUserLogins < ActiveRecord::Migration[5.2] def change create_table :user_logins do |t| t.string :email, :length => 255 diff --git a/db/migrate/20150831105016_add_salt_to_user_login.rb b/db/migrate/20150831105016_add_salt_to_user_login.rb index 6c85daa..23d1cc5 100644 --- a/db/migrate/20150831105016_add_salt_to_user_login.rb +++ b/db/migrate/20150831105016_add_salt_to_user_login.rb @@ -1,4 +1,4 @@ -class AddSaltToUserLogin < ActiveRecord::Migration +class AddSaltToUserLogin < ActiveRecord::Migration[5.2] def change add_column :user_logins, :salt, :string end diff --git a/db/schema.rb b/db/schema.rb index 4146028..94275a2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,40 +10,40 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150831105016) do +ActiveRecord::Schema.define(version: 2015_08_31_105016) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "articles", force: :cascade do |t| - t.string "title" - t.text "body" - t.datetime "created_at" - t.datetime "updated_at" + t.string "title" + t.text "body" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "user_logins", force: :cascade do |t| - t.string "email" - t.string "name" - t.string "password_digest" - t.string "image_url" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "salt" + t.string "email" + t.string "name" + t.string "password_digest" + t.string "image_url" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "salt" end create_table "users", force: :cascade do |t| - t.string "provider", null: false - t.string "uid", null: false - t.string "name" - t.string "location" - t.string "image_url" - t.string "url" + t.string "provider", null: false + t.string "uid", null: false + t.string "name" + t.string "location" + t.string "image_url" + t.string "url" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["provider", "uid"], name: "index_users_on_provider_and_uid", unique: true, using: :btree - t.index ["provider"], name: "index_users_on_provider", using: :btree - t.index ["uid"], name: "index_users_on_uid", using: :btree + t.index ["provider", "uid"], name: "index_users_on_provider_and_uid", unique: true + t.index ["provider"], name: "index_users_on_provider" + t.index ["uid"], name: "index_users_on_uid" end end diff --git a/docs/notes.md b/docs/notes.md new file mode 100644 index 0000000..789fbda --- /dev/null +++ b/docs/notes.md @@ -0,0 +1,6 @@ +##### Displaying ENV from the View Layer +# ERB +<%= debug ENV.to_h.to_yaml %> + +# HAML += debug ENV.to_h.to_yaml diff --git a/docs/upgrading_ruby3.1.0.md b/docs/upgrading_ruby3.1.0.md new file mode 100644 index 0000000..6161823 --- /dev/null +++ b/docs/upgrading_ruby3.1.0.md @@ -0,0 +1,61 @@ +$ bundle update +Fetching gem metadata from https://rubygems.org/ +Installing rails 7.2.2.2 (was 5.2.8) +... +... +Installing devise 4.9.4 (was 4.8.1) +Bundle updated! +Post-install message from devise: + +[DEVISE] Please review the [changelog] and [upgrade guide] for more info on Hotwire / Turbo integration. + + [changelog] https://github.com/heartcombo/devise/blob/main/CHANGELOG.md + [upgrade guide] https://github.com/heartcombo/devise/wiki/How-To:-Upgrade-to-Devise-4.9.0-%5BHotwire-Turbo-integration%5D + Post-install message from oauth2: + +You have installed oauth2 version 1.4.11, which is EOL. +No further support is anticipated for the 1.4.x series. + +OAuth2 version 2 is released. +There are BREAKING changes, but most will not encounter them, and upgrading should be easy! + +We have made two other major migrations: +1. master branch renamed to main +2. Github has been replaced with Gitlab + +Please see: +• https://gitlab.com/oauth-xx/oauth2#what-is-new-for-v20 +• https://gitlab.com/oauth-xx/oauth2/-/blob/main/CHANGELOG.md +• https://groups.google.com/g/oauth-ruby/c/QA_dtrXWXaE + +Please upgrade, report issues, and support the project! Thanks, |7eter l-|. l3oling + +Post-install message from twitter: +📣 Attention Twitter Ruby Gem User! +If you're seeing this message, that means you're using the old Twitter Ruby gem +which is no longer maintained and will not support Twitter API v2. + +🎉 Here's the good news: +We recommend switching to the X gem, which supports both v1.1 and v2 to make +the transition easier. It's a robust, modern libary that is designed to ensure +you'll be able to easily integrate any new changes Twitter/X may roll out. + +🔗 For more details, visit: https://sferik.github.io/x-ruby/ + +🤔 Why consider sponsoring? +The X gem is free to use, but with new API pricing tiers, it actually costs +money to develop and maintain. By contributing to the project, you help us: + +1. 🛠 Maintain the library: Keeping it up-to-date and secure. +2. 🌈 Add new features: Enhancements that make your life easier. +3. 💬 Provide support: Faster responses to issues and feature requests. +⭐️ Bonus: Sponsors will get priority support and influence over the project +roadmap. We will also list your name or your company's logo on our GitHub page. + +🔗 To sponsor, visit: https://github.com/sponsors/sferik + +Building and maintaining an open-source project like this takes a considerable +amount of time and effort. Your sponsorship can help sustain this project. Even +a small monthly donation makes a huge difference! + +💖 Thanks for considering sponsorship. Together we can make the X gem even better! diff --git a/test/controllers/privacy_policy_controller_test.rb b/test/controllers/privacy_policy_controller_test.rb new file mode 100644 index 0000000..9f602c7 --- /dev/null +++ b/test/controllers/privacy_policy_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class PrivacyPolicyControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/terms_of_use_controller_test.rb b/test/controllers/terms_of_use_controller_test.rb new file mode 100644 index 0000000..aeb16e6 --- /dev/null +++ b/test/controllers/terms_of_use_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class TermsOfUseControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end