Skip to content

Commit

Permalink
update to rails 5.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
phoet committed Apr 30, 2019
1 parent 8b81f95 commit 7f6a871
Show file tree
Hide file tree
Showing 17 changed files with 202 additions and 119 deletions.
6 changes: 1 addition & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ruby '~> 2.5.0'

gem 'puma'
gem 'dotenv-rails', require: 'dotenv/rails-now'
gem 'rails', '5.0.7.2'
gem 'rails', '5.2.3'
gem 'pg', '1.1.4'
gem 'rack-cache'
gem 'slim-rails'
Expand Down Expand Up @@ -47,16 +47,12 @@ group :development do
end

group :development, :test do
gem 'active_record_query_trace'
gem 'letter_opener'
gem 'faker'
gem 'byebug'
gem 'rspec-rails'
gem 'rspec-collection_matchers'
gem 'factory_bot_rails'
gem 'meta_request'
gem 'better_errors'
gem 'binding_of_caller'
gem 'rails-controller-testing'
gem 'localer'
end
115 changes: 51 additions & 64 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
GEM
remote: http://rubygems.org/
specs:
actioncable (5.0.7.2)
actionpack (= 5.0.7.2)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
actioncable (5.2.3)
actionpack (= 5.2.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.3)
actionpack (= 5.2.3)
actionview (= 5.2.3)
activejob (= 5.2.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.7.2)
actionview (= 5.0.7.2)
activesupport (= 5.0.7.2)
actionpack (5.2.3)
actionview (= 5.2.3)
activesupport (= 5.2.3)
rack (~> 2.0)
rack-test (~> 0.6.3)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.7.2)
activesupport (= 5.0.7.2)
actionview (5.2.3)
activesupport (= 5.2.3)
builder (~> 3.1)
erubis (~> 2.7.0)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_record_query_trace (1.6.2)
activejob (5.0.7.2)
activesupport (= 5.0.7.2)
activejob (5.2.3)
activesupport (= 5.2.3)
globalid (>= 0.3.6)
activemodel (5.0.7.2)
activesupport (= 5.0.7.2)
activerecord (5.0.7.2)
activemodel (= 5.0.7.2)
activesupport (= 5.0.7.2)
arel (~> 7.0)
activesupport (5.0.7.2)
activemodel (5.2.3)
activesupport (= 5.2.3)
activerecord (5.2.3)
activemodel (= 5.2.3)
activesupport (= 5.2.3)
arel (>= 9.0)
activestorage (5.2.3)
actionpack (= 5.2.3)
activerecord (= 5.2.3)
marcel (~> 0.3.1)
activesupport (5.2.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -57,21 +60,13 @@ GEM
sass-rails (~> 5.0)
selectize-rails (~> 0.6)
ansi (1.5.0)
arel (7.1.4)
arel (9.0.0)
ast (2.4.0)
autoprefixer-rails (9.5.1)
execjs
better_errors (2.5.1)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
builder (3.2.3)
byebug (11.0.1)
callsite (0.0.11)
chunky_png (1.3.10)
coderay (1.1.2)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
Expand Down Expand Up @@ -101,7 +96,6 @@ GEM
dalli (2.7.10)
datetime_picker_rails (0.0.7)
momentjs-rails (>= 2.8.1)
debug_inspector (0.0.3)
decent_exposure (3.0.2)
activesupport (>= 4.0)
diff-lcs (1.3)
Expand All @@ -111,7 +105,6 @@ GEM
railties (>= 3.2, < 6.1)
dry-initializer (2.3.0)
erubi (1.8.0)
erubis (2.7.0)
ethon (0.11.0)
ffi (>= 1.3.0)
exception_notification (4.2.2)
Expand Down Expand Up @@ -198,11 +191,10 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
meta_request (0.7.0)
callsite (~> 0.0, >= 0.0.11)
rack-contrib (>= 1.1, < 3)
railties (>= 3.0.0, < 7)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mimemagic (0.3.3)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
Expand Down Expand Up @@ -250,21 +242,20 @@ GEM
rack (2.0.7)
rack-cache (1.9.0)
rack (>= 0.4)
rack-contrib (2.1.0)
rack (~> 2.0)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7.2)
actioncable (= 5.0.7.2)
actionmailer (= 5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
activemodel (= 5.0.7.2)
activerecord (= 5.0.7.2)
activesupport (= 5.0.7.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.3)
actioncable (= 5.2.3)
actionmailer (= 5.2.3)
actionpack (= 5.2.3)
actionview (= 5.2.3)
activejob (= 5.2.3)
activemodel (= 5.2.3)
activerecord (= 5.2.3)
activestorage (= 5.2.3)
activesupport (= 5.2.3)
bundler (>= 1.3.0)
railties (= 5.0.7.2)
railties (= 5.2.3)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
Expand All @@ -280,12 +271,12 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (5.0.7.2)
actionpack (= 5.0.7.2)
activesupport (= 5.0.7.2)
railties (5.2.3)
actionpack (= 5.2.3)
activesupport (= 5.2.3)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
thor (>= 0.19.0, < 2.0)
rake (12.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
Expand Down Expand Up @@ -357,7 +348,7 @@ GEM
iso8601 (~> 0.9.1)
net_http_timeout_errors (~> 0.3.0)
oga (~> 2.7)
websocket-driver (0.6.5)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
whitelabel (0.3.0)
Expand All @@ -366,12 +357,9 @@ PLATFORMS
ruby

DEPENDENCIES
active_record_query_trace
acts_as_api
addressable
administrate
better_errors
binding_of_caller
byebug
coffee-rails
compass-rails
Expand All @@ -393,7 +381,6 @@ DEPENDENCIES
listen
localer
lograge (~> 0.11.0)
meta_request
omniauth
omniauth-github
omniauth-twitter
Expand All @@ -402,7 +389,7 @@ DEPENDENCIES
public_suffix
puma
rack-cache
rails (= 5.0.7.2)
rails (= 5.2.3)
rails-controller-testing
rails_12factor (~> 0.0.2)
redcarpet
Expand Down
10 changes: 5 additions & 5 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class User < ApplicationRecord
validates :twitter, :github, format: { with: /\A(\w|-)+\z/, allow_nil: true, allow_blank: true }

has_many :authorizations, dependent: :destroy
has_many :participants, { dependent: :destroy }, -> { order('created_at DESC') }
has_many :materials, { dependent: :destroy }, -> { order('created_at DESC') }
has_many :topics, { dependent: :destroy }, -> { order('created_at DESC') }
has_many :likes, { dependent: :destroy }, -> { order('created_at DESC') }
has_many :participants, -> { order('created_at DESC') }, dependent: :destroy
has_many :materials, -> { order('created_at DESC') }, dependent: :destroy
has_many :topics, -> { order('created_at DESC') }, dependent: :destroy
has_many :likes, -> { order('created_at DESC') }, dependent: :destroy
has_many :participations, through: :participants, source: :event
has_many :liked_topics, through: :likes, source: :topic
has_many :liked_topics, through: :likes, source: :topic
has_many :events, -> { order('created_at DESC') }

scope :organizers, -> { where(nickname: Whitelabel[:organizers]) }
Expand Down
2 changes: 1 addition & 1 deletion bin/bundle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
load Gem.bin_path('bundler', 'bundle')
6 changes: 4 additions & 2 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
APP_ROOT = File.expand_path('..', __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
Expand All @@ -18,6 +17,9 @@ chdir APP_ROOT do
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')

# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
Expand Down
6 changes: 4 additions & 2 deletions bin/update
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
APP_ROOT = File.expand_path('..', __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
Expand All @@ -18,6 +17,9 @@ chdir APP_ROOT do
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')

puts "\n== Updating database =="
system! 'bin/rails db:migrate'

Expand Down
11 changes: 11 additions & 0 deletions bin/yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
begin
exec "yarnpkg", *ARGV
rescue Errno::ENOENT
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
end
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

module OnRuby
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.0

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
Expand Down
1 change: 1 addition & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
# require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
16 changes: 12 additions & 4 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,26 @@
config.consider_all_requests_local = true

# Enable/disable caching. By default caching is disabled.
if Rails.root.join('tmp/caching-dev.txt').exist?
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
config.action_controller.perform_caching = true

config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800'
'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.delivery_method = :letter_opener

config.action_mailer.perform_caching = false

# Print deprecation notices to the Rails logger.
Expand All @@ -37,12 +41,14 @@
# 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

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true

config.middleware.use "CookieDomain", ".onruby.test"
# Suppress logger output for asset requests.
config.assets.quiet = true

Expand All @@ -52,4 +58,6 @@
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker

config.middleware.use CookieDomain, ".onruby.test"
end
Loading

0 comments on commit 7f6a871

Please sign in to comment.