From c963cf058b6cb613e987e963aaf5993c29f13c52 Mon Sep 17 00:00:00 2001 From: Brandon Roberson Date: Wed, 8 Nov 2023 16:49:38 +0000 Subject: [PATCH] Update for rails 6.1 and ruby 3.2 Signed-off-by: Geoff Franks Signed-off-by: Brandon Roberson --- .gitignore | 2 + Gemfile | 31 +- Gemfile.lock | 315 ++++++++++++------ app/assets/config/manifest.js | 4 + app/assets/images/.keep | 0 app/assets/stylesheets/.gitkeep | 0 app/controllers/microposts_controller.rb | 8 +- app/controllers/relationships_controller.rb | 4 +- app/controllers/users_controller.rb | 8 +- app/javascript/.gitkeep | 0 app/models/micropost.rb | 6 +- app/models/relationship.rb | 2 - app/models/user.rb | 1 - bin/rails | 18 +- bin/rake | 18 +- bin/setup | 33 ++ config/credentials.yml.enc | 1 + config/database.yml | 5 +- config/environments/development.rb | 2 + config/environments/production.rb | 4 + config/environments/test.rb | 2 + config/routes.rb | 12 +- config/storage.yml | 34 ++ db/migrate/20100821203213_create_users.rb | 2 +- ...100822012431_add_email_uniqueness_index.rb | 2 +- .../20100822204528_add_password_to_users.rb | 2 +- .../20100822233125_add_salt_to_users.rb | 2 +- .../20100829021049_add_admin_to_users.rb | 2 +- .../20100829210229_create_microposts.rb | 2 +- .../20100831012055_create_relationships.rb | 2 +- manifest.yml | 2 +- vendor/javascript/.gitkeep | 0 32 files changed, 336 insertions(+), 190 deletions(-) create mode 100644 app/assets/config/manifest.js create mode 100644 app/assets/images/.keep create mode 100644 app/assets/stylesheets/.gitkeep create mode 100644 app/javascript/.gitkeep create mode 100755 bin/setup create mode 100644 config/credentials.yml.enc create mode 100644 config/storage.yml create mode 100644 vendor/javascript/.gitkeep diff --git a/.gitignore b/.gitignore index c2abe9eb..d5456753 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ doc/ *~ .project .DS_Store + +/config/master.key diff --git a/Gemfile b/Gemfile index dbcf3c21..c1043813 100644 --- a/Gemfile +++ b/Gemfile @@ -1,25 +1,26 @@ source 'http://rubygems.org' -gem 'rails', '3.0.12' -gem 'gravatar_image_tag', '1.0.0.pre2' -gem 'will_paginate', '3.0.pre2' -gem 'sqlite3', '1.3.4' -gem "pg", "~> 0.15.1" -gem "cf-autoconfig", "~> 0.2.1" -gem 'rails_12factor', group: :production -ruby '2.1.9' +gem 'rails', '~> 6.1' +gem 'gravatar_image_tag' +gem 'will_paginate' +gem 'sqlite3' +gem 'mysql2' +gem 'pg' +gem "cf-autoconfig" +gem 'rails_12factor' +gem 'thin' +ruby '~> 3.2' group :development do - gem 'rspec-rails', '2.6.1' - gem 'annotate', '2.4.0' - gem 'faker', '0.3.1' + gem 'rspec-rails' + gem 'annotate' + gem 'faker' end group :test do - gem 'rspec-rails', '2.6.1' - gem 'webrat', '0.7.1' - gem 'spork', '0.9.0.rc8' - gem 'factory_girl_rails', '1.0' + gem 'webrat' + gem 'spork' + gem 'factory_girl_rails' # gem 'autotest', '4.4.6' # gem 'autotest-rails-pure', '4.1.2' # gem 'autotest-fsevent', '0.2.4' diff --git a/Gemfile.lock b/Gemfile.lock index 31a85bdc..a5163ba7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,126 +1,221 @@ GEM remote: http://rubygems.org/ specs: - abstract (1.0.0) - actionmailer (3.0.12) - actionpack (= 3.0.12) - mail (~> 2.2.19) - actionpack (3.0.12) - activemodel (= 3.0.12) - activesupport (= 3.0.12) - builder (~> 2.1.2) - erubis (~> 2.6.6) - i18n (~> 0.5.0) - rack (~> 1.2.5) - rack-mount (~> 0.6.14) - rack-test (~> 0.5.7) - tzinfo (~> 0.3.23) - activemodel (3.0.12) - activesupport (= 3.0.12) - builder (~> 2.1.2) - i18n (~> 0.5.0) - activerecord (3.0.12) - activemodel (= 3.0.12) - activesupport (= 3.0.12) - arel (~> 2.0.10) - tzinfo (~> 0.3.23) - activeresource (3.0.12) - activemodel (= 3.0.12) - activesupport (= 3.0.12) - activesupport (3.0.12) - annotate (2.4.0) - arel (2.0.10) - builder (2.1.2) + actioncable (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) + mail (>= 2.7.1) + actionmailer (6.1.7.6) + actionpack (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activesupport (= 6.1.7.6) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.1.7.6) + actionview (= 6.1.7.6) + activesupport (= 6.1.7.6) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.7.6) + actionpack (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) + nokogiri (>= 1.8.5) + actionview (6.1.7.6) + activesupport (= 6.1.7.6) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.7.6) + activesupport (= 6.1.7.6) + globalid (>= 0.3.6) + activemodel (6.1.7.6) + activesupport (= 6.1.7.6) + activerecord (6.1.7.6) + activemodel (= 6.1.7.6) + activesupport (= 6.1.7.6) + activestorage (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activesupport (= 6.1.7.6) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + annotate (3.2.0) + activerecord (>= 3.2, < 8.0) + rake (>= 10.4, < 14.0) + builder (3.2.4) cf-autoconfig (0.2.1) cf-runtime (= 0.2.0) cf-runtime (0.2.0) - diff-lcs (1.1.2) - erubis (2.6.6) - abstract (>= 1.0.0) - factory_girl (1.3.3) - factory_girl_rails (1.0) - factory_girl (~> 1.3) - rails (>= 3.0.0.beta4) - faker (0.3.1) - gravatar_image_tag (1.0.0.pre2) - i18n (0.5.0) - json (1.6.6) - mail (2.2.19) - activesupport (>= 2.3.6) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.18) - nokogiri (1.4.4) - pg (0.15.1) - polyglot (0.3.3) - rack (1.2.5) - rack-mount (0.6.14) - rack (>= 1.0.0) - rack-test (0.5.7) - rack (>= 1.0) - rails (3.0.12) - actionmailer (= 3.0.12) - actionpack (= 3.0.12) - activerecord (= 3.0.12) - activeresource (= 3.0.12) - activesupport (= 3.0.12) - bundler (~> 1.0) - railties (= 3.0.12) - rails_12factor (0.0.2) + concurrent-ruby (1.2.2) + crass (1.0.6) + daemons (1.4.1) + date (3.3.4) + diff-lcs (1.5.0) + erubi (1.12.0) + eventmachine (1.2.7) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + faker (3.2.2) + i18n (>= 1.8.11, < 2) + globalid (1.2.1) + activesupport (>= 6.1) + gravatar_image_tag (1.2.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + loofah (2.21.4) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.5) + minitest (5.20.0) + mysql2 (0.5.5) + net-imap (0.4.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0) + net-protocol + nio4r (2.5.9) + nokogiri (1.15.4-x86_64-linux) + racc (~> 1.4) + pg (1.5.4) + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails (6.1.7.6) + actioncable (= 6.1.7.6) + actionmailbox (= 6.1.7.6) + actionmailer (= 6.1.7.6) + actionpack (= 6.1.7.6) + actiontext (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activemodel (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) + bundler (>= 1.15.0) + railties (= 6.1.7.6) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging - rails_serve_static_assets (0.0.2) - rails_stdout_logging (0.0.3) - railties (3.0.12) - actionpack (= 3.0.12) - activesupport (= 3.0.12) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (~> 0.14.4) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - rspec (2.6.0) - rspec-core (~> 2.6.0) - rspec-expectations (~> 2.6.0) - rspec-mocks (~> 2.6.0) - rspec-core (2.6.4) - rspec-expectations (2.6.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.6.0) - rspec-rails (2.6.1) - actionpack (~> 3.0) - activesupport (~> 3.0) - railties (~> 3.0) - rspec (~> 2.6.0) - spork (0.9.0.rc8) - sqlite3 (1.3.4) - thor (0.14.6) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.32) - webrat (0.7.1) + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.5) + railties (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) + method_source + rake (>= 12.2) + thor (~> 1.0) + rake (13.1.0) + 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.0.3) + 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) + spork (0.9.2) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.6.8-x86_64-linux) + thin (1.8.2) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (>= 1, < 3) + thor (1.3.0) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + webrat (0.7.3) nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) - will_paginate (3.0.pre2) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + will_paginate (4.0.0) + zeitwerk (2.6.12) PLATFORMS - ruby + x86_64-linux DEPENDENCIES - annotate (= 2.4.0) - cf-autoconfig (~> 0.2.1) - factory_girl_rails (= 1.0) - faker (= 0.3.1) - gravatar_image_tag (= 1.0.0.pre2) - pg (~> 0.15.1) - rails (= 3.0.12) + annotate + cf-autoconfig + factory_girl_rails + faker + gravatar_image_tag + mysql2 + pg + rails (~> 6.1) rails_12factor - rspec-rails (= 2.6.1) - spork (= 0.9.0.rc8) - sqlite3 (= 1.3.4) - webrat (= 0.7.1) - will_paginate (= 3.0.pre2) + rspec-rails + spork + sqlite3 + thin + webrat + will_paginate + +RUBY VERSION + ruby 3.2.2p53 + +BUNDLED WITH + 2.4.21 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 00000000..ddd546a0 --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,4 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css +//= link_tree ../../javascript .js +//= link_tree ../../../vendor/javascript .js diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 00000000..e69de29b diff --git a/app/assets/stylesheets/.gitkeep b/app/assets/stylesheets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/app/controllers/microposts_controller.rb b/app/controllers/microposts_controller.rb index 4113720f..a8244dd0 100644 --- a/app/controllers/microposts_controller.rb +++ b/app/controllers/microposts_controller.rb @@ -1,9 +1,9 @@ class MicropostsController < ApplicationController - before_filter :authenticate - before_filter :authorized_user, :only => :destroy + before_action :authenticate + before_action :authorized_user, :only => :destroy def create - @micropost = current_user.microposts.build(params[:micropost]) + @micropost = current_user.microposts.build(params[:micropost].permit([:content])) if @micropost.save redirect_to root_path, :flash => { :success => "Micropost created!" } else @@ -23,4 +23,4 @@ def authorized_user @micropost = current_user.microposts.find_by_id(params[:id]) redirect_to root_path if @micropost.nil? end -end \ No newline at end of file +end diff --git a/app/controllers/relationships_controller.rb b/app/controllers/relationships_controller.rb index c7e69c83..422f7986 100644 --- a/app/controllers/relationships_controller.rb +++ b/app/controllers/relationships_controller.rb @@ -1,5 +1,5 @@ class RelationshipsController < ApplicationController - before_filter :authenticate + before_action :authenticate def create @user = User.find(params[:relationship][:followed_id]) @@ -18,4 +18,4 @@ def destroy format.js end end -end \ No newline at end of file +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 603d1c56..01cd1456 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,9 +1,9 @@ class UsersController < ApplicationController - before_filter :authenticate, + before_action :authenticate, :only => [:index, :edit, :update, :destroy, :followers, :following] - before_filter :correct_user, :only => [:edit, :update] - before_filter :admin_user, :only => :destroy + before_action :correct_user, :only => [:edit, :update] + before_action :admin_user, :only => :destroy def index @users = User.paginate(:page => params[:page]) @@ -36,7 +36,7 @@ def new end def create - @user = User.new(params[:user]) + @user = User.new(params[:user].permit([:name, :password, :password_confirmation, :email])) if @user.save sign_in @user redirect_to @user, :flash => { :success => "Welcome to the Sample App!" } diff --git a/app/javascript/.gitkeep b/app/javascript/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/app/models/micropost.rb b/app/models/micropost.rb index 2eb04765..9720dcae 100644 --- a/app/models/micropost.rb +++ b/app/models/micropost.rb @@ -11,14 +11,12 @@ # class Micropost < ActiveRecord::Base - attr_accessible :content - belongs_to :user validates :content, :presence => true, :length => { :maximum => 140 } validates :user_id, :presence => true - default_scope :order => 'microposts.created_at DESC' + default_scope { :order => 'microposts.created_at DESC' } scope :from_users_followed_by, lambda { |user| followed_by(user) } @@ -30,4 +28,4 @@ def self.followed_by(user) where("user_id IN (#{following_ids}) OR user_id = :user_id", :user_id => user) end -end \ No newline at end of file +end diff --git a/app/models/relationship.rb b/app/models/relationship.rb index d024bb7c..25fab1c6 100644 --- a/app/models/relationship.rb +++ b/app/models/relationship.rb @@ -11,8 +11,6 @@ # class Relationship < ActiveRecord::Base - attr_accessible :followed_id - belongs_to :follower, :class_name => "User" belongs_to :followed, :class_name => "User" diff --git a/app/models/user.rb b/app/models/user.rb index d95a16d3..00bc11bf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,7 +15,6 @@ class User < ActiveRecord::Base attr_accessor :password - attr_accessible :name, :email, :password, :password_confirmation has_many :microposts, :dependent => :destroy has_many :relationships, :dependent => :destroy, diff --git a/bin/rails b/bin/rails index daa4a399..6fb4e405 100755 --- a/bin/rails +++ b/bin/rails @@ -1,16 +1,4 @@ #!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rails' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rails', 'rails') +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake index 26c7a2d5..4fbf10b9 100755 --- a/bin/rake +++ b/bin/rake @@ -1,16 +1,4 @@ #!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rake' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rake', 'rake') +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 00000000..57923026 --- /dev/null +++ b/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/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 00000000..ae623b92 --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +S5lUvLZOSVFTUX3eGl32Wd3eRPS85G0uLza9SWjCRzoS4q08ycMKl/72Kj8FvPoWiH9C6r2JS1dMJFEWmZYc6TOYDYImeioZ2QqfnRCz0bDMtJVJ/hQxcMdvhu1/aNv30ClI99iPPMGUDs7Ag03e2qGs5D0aUZM4P2YxB5x1CiqQARE7n7ibzRy89ZetSEYObHM/GO4h7J1JM7qroyUP2LFZISbySq8kCq725ON2Hdohi6N/Wcnm5Pt9yuS8+bmMDj6nubsp1A455PaRFWZ0YBqKKXF0SK71rRvo+UljztbYgQ1BafuK2M8+z3mWC/k8/Q2Hw9/HR+ZkvDcFYdspeMWiZKGvKPwSLVCks6k/PvFFFbp+pjKzfc1kq2LuEUFbLtac3YR9U0tx5Pz1bLl2VzAFOcgh--2mZkm5ROpLfKtzqe--x12TVIN2sWh7CyJ2HfKG0A== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index 025d62a8..78966dae 100644 --- a/config/database.yml +++ b/config/database.yml @@ -16,7 +16,4 @@ test: timeout: 5000 production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 + uri: <%= ENV.fetch("DATABASE_URL") %> diff --git a/config/environments/development.rb b/config/environments/development.rb index 8064061e..c4fc7031 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -9,6 +9,8 @@ # Log error messages when you accidentally call methods on nil. config.whiny_nils = true + config.eager_load = false + # Show full error reports and disable caching config.consider_all_requests_local = true config.action_view.debug_rjs = true diff --git a/config/environments/production.rb b/config/environments/production.rb index 0fad1b0f..d3cf5d90 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -5,6 +5,8 @@ # Code is not reloaded between requests config.cache_classes = true + 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 @@ -30,6 +32,8 @@ # Disable Rails's static asset server # In production, Apache or nginx will already do this config.serve_static_assets = false + config.assets.quiet = true + config.assets.compile = false # Enable serving of images, stylesheets, and javascripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" diff --git a/config/environments/test.rb b/config/environments/test.rb index b5586f08..593a889f 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -7,6 +7,8 @@ # and recreated between test runs. Don't rely on the data there! config.cache_classes = true + config.eager_load = false + # Log error messages when you accidentally call methods on nil. config.whiny_nils = true diff --git a/config/routes.rb b/config/routes.rb index ca006a8d..dde2d6cf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,12 +12,12 @@ root :to => "pages#home" - match '/contact', :to => 'pages#contact' - match '/about', :to => 'pages#about' - match '/help', :to => 'pages#help' - match '/signup', :to => 'users#new' - match '/signin', :to => 'sessions#new' - match '/signout', :to => 'sessions#destroy' + get '/contact', :to => 'pages#contact' + get '/about', :to => 'pages#about' + get '/help', :to => 'pages#help' + get '/signup', :to => 'users#new' + get '/signin', :to => 'sessions#new' + get '/signout', :to => 'sessions#destroy' # The priority is based upon order of creation: # first created -> highest priority. diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 00000000..4942ab66 --- /dev/null +++ b/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/db/migrate/20100821203213_create_users.rb b/db/migrate/20100821203213_create_users.rb index 805ba7b3..647e2c46 100644 --- a/db/migrate/20100821203213_create_users.rb +++ b/db/migrate/20100821203213_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration +class CreateUsers < ActiveRecord::Migration[6.1] def self.up create_table :users do |t| t.string :name diff --git a/db/migrate/20100822012431_add_email_uniqueness_index.rb b/db/migrate/20100822012431_add_email_uniqueness_index.rb index 95c5122c..7b3c2bf6 100644 --- a/db/migrate/20100822012431_add_email_uniqueness_index.rb +++ b/db/migrate/20100822012431_add_email_uniqueness_index.rb @@ -1,4 +1,4 @@ -class AddEmailUniquenessIndex < ActiveRecord::Migration +class AddEmailUniquenessIndex < ActiveRecord::Migration[6.1] def self.up add_index :users, :email, :unique => true end diff --git a/db/migrate/20100822204528_add_password_to_users.rb b/db/migrate/20100822204528_add_password_to_users.rb index 0621dc1f..9e9d52a8 100644 --- a/db/migrate/20100822204528_add_password_to_users.rb +++ b/db/migrate/20100822204528_add_password_to_users.rb @@ -1,4 +1,4 @@ -class AddPasswordToUsers < ActiveRecord::Migration +class AddPasswordToUsers < ActiveRecord::Migration[6.1] def self.up add_column :users, :encrypted_password, :string end diff --git a/db/migrate/20100822233125_add_salt_to_users.rb b/db/migrate/20100822233125_add_salt_to_users.rb index 11e8f531..80051396 100644 --- a/db/migrate/20100822233125_add_salt_to_users.rb +++ b/db/migrate/20100822233125_add_salt_to_users.rb @@ -1,4 +1,4 @@ -class AddSaltToUsers < ActiveRecord::Migration +class AddSaltToUsers < ActiveRecord::Migration[6.1] def self.up add_column :users, :salt, :string end diff --git a/db/migrate/20100829021049_add_admin_to_users.rb b/db/migrate/20100829021049_add_admin_to_users.rb index ad38d916..a251b982 100644 --- a/db/migrate/20100829021049_add_admin_to_users.rb +++ b/db/migrate/20100829021049_add_admin_to_users.rb @@ -1,4 +1,4 @@ -class AddAdminToUsers < ActiveRecord::Migration +class AddAdminToUsers < ActiveRecord::Migration[6.1] def self.up add_column :users, :admin, :boolean, :default => false end diff --git a/db/migrate/20100829210229_create_microposts.rb b/db/migrate/20100829210229_create_microposts.rb index 41ddf675..76ddbfae 100644 --- a/db/migrate/20100829210229_create_microposts.rb +++ b/db/migrate/20100829210229_create_microposts.rb @@ -1,4 +1,4 @@ -class CreateMicroposts < ActiveRecord::Migration +class CreateMicroposts < ActiveRecord::Migration[6.1] def self.up create_table :microposts do |t| t.string :content diff --git a/db/migrate/20100831012055_create_relationships.rb b/db/migrate/20100831012055_create_relationships.rb index a0fcddfd..82428b25 100644 --- a/db/migrate/20100831012055_create_relationships.rb +++ b/db/migrate/20100831012055_create_relationships.rb @@ -1,4 +1,4 @@ -class CreateRelationships < ActiveRecord::Migration +class CreateRelationships < ActiveRecord::Migration[6.1] def self.up create_table :relationships do |t| t.integer :follower_id diff --git a/manifest.yml b/manifest.yml index 42872f93..0890b04c 100644 --- a/manifest.yml +++ b/manifest.yml @@ -5,6 +5,6 @@ applications: memory: 256M instances: 1 path: . - command: bundle exec rake db:migrate && bundle exec rails s -p $PORT + command: bundle exec rake db:migrate && bundle exec rails s -u thin -p $PORT services: - rails-postgres diff --git a/vendor/javascript/.gitkeep b/vendor/javascript/.gitkeep new file mode 100644 index 00000000..e69de29b