Skip to content

Commit

Permalink
Upgrade to Rails 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Nov 10, 2023
1 parent 00f0bd0 commit c75b31c
Show file tree
Hide file tree
Showing 29 changed files with 242 additions and 133 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ADD Gemfile.lock /app/
RUN bundle install --jobs 3 --deployment --without development test

# Default environment settings
ENV RAILS_SERVE_STATIC_FILES true
ENV LOG_TO_STDOUT true
ENV INSTEDD_THEME //theme.instedd.org
ENV RAILS_ENV production
Expand Down
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

# framework
gem 'rails', '~> 4.1.15'
gem 'rails', '~> 4.2.11'

# services
gem "elasticsearch", '~> 1.0.17'
Expand Down Expand Up @@ -49,6 +49,9 @@ gem 'treetop', '1.4.15'
gem 'uuidtools'
gem 'will_paginate'

# deprecated (to fix upgrades)
gem "loofah", "2.20.0" if RUBY_VERSION.to_f < 2.5

# templates
gem 'haml-rails', '~> 0.4'
gem 'haml-magic-translations'
Expand Down
113 changes: 69 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,47 +44,55 @@ GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
actionmailer (4.1.16)
actionpack (= 4.1.16)
actionview (= 4.1.16)
actionmailer (4.2.11.3)
actionpack (= 4.2.11.3)
actionview (= 4.2.11.3)
activejob (= 4.2.11.3)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.16)
actionview (= 4.1.16)
activesupport (= 4.1.16)
rack (~> 1.5.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.11.3)
actionview (= 4.2.11.3)
activesupport (= 4.2.11.3)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actionpack-page_caching (1.2.4)
actionpack (>= 4.0.0)
actionview (4.1.16)
activesupport (= 4.1.16)
actionview (4.2.11.3)
activesupport (= 4.2.11.3)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_model_serializers (0.10.14)
actionpack (>= 4.1)
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activemodel (4.1.16)
activesupport (= 4.1.16)
activejob (4.2.11.3)
activesupport (= 4.2.11.3)
globalid (>= 0.3.0)
activemodel (4.2.11.3)
activesupport (= 4.2.11.3)
builder (~> 3.1)
activerecord (4.1.16)
activemodel (= 4.1.16)
activesupport (= 4.1.16)
arel (~> 5.0.0)
activerecord (4.2.11.3)
activemodel (= 4.2.11.3)
activesupport (= 4.2.11.3)
arel (~> 6.0)
activerecord-import (0.28.2)
activerecord (>= 3.2)
activesupport (4.1.16)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
activesupport (4.2.11.3)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
arel (5.0.1.20140414130214)
arel (6.0.4)
attr_required (1.0.1)
bcrypt (3.1.19)
bindata (2.4.14)
Expand Down Expand Up @@ -116,6 +124,7 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.2.2)
crass (1.0.6)
dalli (2.7.11)
database_cleaner (1.99.0)
decent_exposure (2.3.3)
Expand Down Expand Up @@ -156,6 +165,8 @@ GEM
global_phone (1.0.1)
global_phone_dbgen (1.0.0)
nokogiri (~> 1.5)
globalid (0.4.2)
activesupport (>= 4.2.0)
google-api-client (0.32.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.5, < 0.10.0)
Expand Down Expand Up @@ -213,8 +224,8 @@ GEM
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.8.6)
json-jwt (1.9.4)
activesupport
json-jwt (1.12.0)
activesupport (>= 4.2)
aes_key_wrap
bindata
jsonapi-renderer (0.2.2)
Expand All @@ -224,6 +235,9 @@ GEM
locale (2.1.3)
lodash-rails (2.4.1)
railties (>= 3.1)
loofah (2.20.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
machinist (1.0.6)
mail (2.7.1)
mini_mime (>= 0.1.1)
Expand Down Expand Up @@ -251,9 +265,9 @@ GEM
json
rest-client
oj (2.15.1)
omniauth (1.4.2)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth (1.9.2)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-openid (1.0.1)
omniauth (~> 1.0)
rack-openid (~> 1.3.1)
Expand All @@ -267,34 +281,43 @@ GEM
polyglot (0.3.5)
public_suffix (4.0.7)
puma (3.11.4)
rack (1.5.5)
rack-oauth2 (1.10.0)
rack (1.6.13)
rack-oauth2 (1.12.0)
activesupport
attr_required
httpclient
json-jwt (>= 1.9.0)
rack
json-jwt (>= 1.11.0)
rack (< 2.1)
rack-openid (1.3.1)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-protection (1.5.5)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.16)
actionmailer (= 4.1.16)
actionpack (= 4.1.16)
actionview (= 4.1.16)
activemodel (= 4.1.16)
activerecord (= 4.1.16)
activesupport (= 4.1.16)
rails (4.2.11.3)
actionmailer (= 4.2.11.3)
actionpack (= 4.2.11.3)
actionview (= 4.2.11.3)
activejob (= 4.2.11.3)
activemodel (= 4.2.11.3)
activerecord (= 4.2.11.3)
activesupport (= 4.2.11.3)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.16)
sprockets-rails (~> 2.0)
railties (= 4.2.11.3)
sprockets-rails
rails-assets-knockout-sortable (1.1.0)
railties (4.1.16)
actionpack (= 4.1.16)
activesupport (= 4.1.16)
rails-deprecated_sanitizer (1.0.4)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.4.4)
loofah (~> 2.19, >= 2.19.1)
railties (4.2.11.3)
actionpack (= 4.2.11.3)
activesupport (= 4.2.11.3)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.1.0)
Expand All @@ -305,8 +328,9 @@ GEM
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
responders (1.1.2)
railties (>= 3.2, < 4.2)
responders (2.4.1)
actionpack (>= 4.2.0, < 6.0)
railties (>= 4.2.0, < 6.0)
resque (1.27.4)
mono_logger (~> 1.0)
multi_json (~> 1.0)
Expand Down Expand Up @@ -454,6 +478,7 @@ DEPENDENCIES
jquery-rails (~> 2.0.2)
knockoutjs-rails (~> 3.2.0)
lodash-rails
loofah (= 2.20.0)
machinist (= 1.0.6)
mini_magick
msgpack (~> 0.7.5)
Expand All @@ -465,7 +490,7 @@ DEPENDENCIES
omniauth-openid (~> 1.0)
paranoia (~> 2.0)
puma (~> 3.11.4)
rails (~> 4.1.15)
rails (~> 4.2.11)
rails-assets-knockout-sortable!
redis (~> 3.1)
resque (~> 1.25)
Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
// compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require instedd-rails
//= require jquery-ui
Expand Down
2 changes: 1 addition & 1 deletion app/workers/email_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class EmailTask
@queue = :email_queue

def self.perform(users_email, message, email_subject)
SendMailer.notify_email(users_email, message, email_subject).deliver
SendMailer.notify_email(users_email, message, email_subject).deliver_now
end
end
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class Application < Rails::Application
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql

# Do not swallow errors in after_commit/after_rollback callbacks (Rails 4.2).
config.active_record.raise_in_transactional_callbacks = true

# Enable the asset pipeline
config.assets.enabled = true

Expand Down
6 changes: 3 additions & 3 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Load the rails application
# Load the Rails application.
require File.expand_path('../application', __FILE__)

# Initialize the rails application
ResourceMap::Application.initialize!
# Initialize the Rails application.
Rails.application.initialize!
32 changes: 25 additions & 7 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
ResourceMap::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

gem 'devise'
# In the development environment your application's code is reloaded on
# every request. 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 and disable caching
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

# Don't care if the mailer can't send
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { :host => Settings.host }
if Settings.smtp.present?
Expand All @@ -32,17 +33,34 @@
end
end

# Print deprecation notices to the Rails logger
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin

# Do not compress assets
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = false # if true, the thin server was too slow in docker environment
# 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 = false

# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

# Uncomment the following line to enable sample profiling (see https://github.com/tmm1/stackprof for details)
# config.middleware.use StackProf::Middleware, enabled: true, mode: :cpu, interval: 100, save_every: 5
Expand Down
Loading

0 comments on commit c75b31c

Please sign in to comment.