Skip to content

Commit

Permalink
Upgrade Rails to 4.2 and Devise to 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmike committed Dec 11, 2016
1 parent 83b6c58 commit ce8a0b2
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 48 deletions.
7 changes: 4 additions & 3 deletions Gemfile
@@ -1,15 +1,15 @@
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.1.0'
gem 'rails', '~> 4.2.0'

# Databases
gem 'sqlite3', group: :development
gem 'mysql2', group: :mysql
gem 'pg', group: :postgresql

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'
gem 'sass-rails'
gem 'haml-rails'
gem "less-rails"

Expand All @@ -21,7 +21,7 @@ gem 'kaminari'
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
gem 'coffee-rails'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
Expand All @@ -41,6 +41,7 @@ group :doc do
end

gem 'devise'
gem 'test_after_commit', :group => :test # https://github.com/plataformatec/devise/blob/master/CHANGELOG.md#410
gem 'omniauth'
gem 'omniauth-github', github: 'alexandrz/omniauth-github', branch: 'provide_emails'
gem 'cancancan'
Expand Down
104 changes: 64 additions & 40 deletions Gemfile.lock
Expand Up @@ -37,31 +37,40 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.16)
actionpack (= 4.1.16)
actionview (= 4.1.16)
actionmailer (4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
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.7.1)
actionview (= 4.2.7.1)
activesupport (= 4.2.7.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
actionview (4.1.16)
activesupport (= 4.1.16)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.16)
activesupport (= 4.1.16)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.7.1)
activesupport (= 4.2.7.1)
globalid (>= 0.3.0)
activemodel (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
activerecord (4.1.16)
activemodel (= 4.1.16)
activesupport (= 4.1.16)
arel (~> 5.0.0)
activesupport (4.1.16)
i18n (~> 0.6, >= 0.6.9)
activerecord (4.2.7.1)
activemodel (= 4.2.7.1)
activesupport (= 4.2.7.1)
arel (~> 6.0)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
Expand All @@ -70,7 +79,7 @@ GEM
airbrake-ruby (1.6.0)
airbrussh (1.1.1)
sshkit (>= 1.6.1, != 1.7.0)
arel (5.0.1.20140414130214)
arel (6.0.3)
bcrypt (3.1.11)
bootstrap_form (2.3.0)
builder (3.2.2)
Expand Down Expand Up @@ -137,12 +146,11 @@ GEM
railties (>= 3, < 5.1)
cucumber-wire (0.0.1)
database_cleaner (1.5.3)
devise (3.5.10)
devise (4.2.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0, < 5.1)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.5)
erubis (2.7.0)
Expand All @@ -160,6 +168,8 @@ GEM
fssm (0.2.10)
gherkin (4.0.0)
github-markdown (0.6.9)
globalid (0.3.7)
activesupport (>= 4.1.0)
haml (4.0.7)
tilt
haml-rails (0.9.0)
Expand Down Expand Up @@ -205,6 +215,8 @@ GEM
sprockets (> 2, < 4)
tilt
libv8 (3.16.14.17)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mime-types (3.1)
Expand Down Expand Up @@ -247,35 +259,44 @@ GEM
public_suffix (2.0.4)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.5.5)
rack (1.6.5)
rack-canonical-host (0.2.2)
addressable (> 0, < 3)
rack (>= 1.0.0, < 3)
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.7.1)
actionmailer (= 4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
activemodel (= 4.2.7.1)
activerecord (= 4.2.7.1)
activesupport (= 4.2.7.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.16)
sprockets-rails (~> 2.0)
railties (= 4.2.7.1)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_autolink (1.1.6)
rails (> 3.1)
railties (4.1.16)
actionpack (= 4.1.16)
activesupport (= 4.1.16)
railties (4.2.7.1)
actionpack (= 4.2.7.1)
activesupport (= 4.2.7.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
rdoc (4.3.0)
redcarpet (3.3.4)
ref (2.0.0)
responders (1.1.2)
railties (>= 3.2, < 4.2)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
rqrcode (0.10.1)
chunky_png (~> 1.0)
rqrcode-rails3 (0.1.7)
Expand Down Expand Up @@ -329,6 +350,8 @@ GEM
sshkit (1.11.4)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
test_after_commit (1.1.0)
activerecord (>= 3.2)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
Expand Down Expand Up @@ -369,7 +392,7 @@ DEPENDENCIES
capistrano-rails
capistrano-rvm!
capybara-screenshot
coffee-rails (~> 4.0.0)
coffee-rails
commontator (~> 4.6.0)
compass-rails
cucumber-rails
Expand All @@ -392,15 +415,16 @@ DEPENDENCIES
poltergeist
quiet_assets
rack-canonical-host
rails (~> 4.1.0)
rails (~> 4.2.0)
rails_autolink
redcarpet
rqrcode-rails3
rspec-rails
sanitize
sass-rails (~> 4.0.2)
sass-rails
sdoc
sqlite3
test_after_commit
therubyracer
timecop
turbolinks
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -21,6 +21,6 @@ def after_sign_in_path_for(user)
end

def configure_permitted_parameters
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:email, :name, :bitcoin_address, :current_password, :password, :password_confirmation) }
devise_parameter_sanitizer.permit(:account_update, keys: [:email, :name, :bitcoin_address, :current_password, :password, :password_confirmation])
end
end
2 changes: 1 addition & 1 deletion app/controllers/registrations_controller.rb
Expand Up @@ -13,7 +13,7 @@ def update
if successfully_updated
set_flash_message :notice, :updated
# Sign in the user bypassing validation in case their password changed
sign_in @user, :bypass => true
bypass_sign_in @user
redirect_to after_update_path_for(@user)
else
render "edit"
Expand Down
2 changes: 1 addition & 1 deletion app/models/tip.rb
Expand Up @@ -85,7 +85,7 @@ def commit_url
def notify_user
if amount and amount > 0 and user and user.bitcoin_address.blank? and !user.unsubscribed
if user.notified_at.nil? or user.notified_at < 30.days.ago
UserMailer.new_tip(user, self).deliver
UserMailer.new_tip(user, self).deliver_now
user.touch :notified_at
end
end
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Expand Up @@ -28,5 +28,7 @@ class Application < Rails::Application
config.autoload_paths += %W(#{config.root}/lib)

I18n.enforce_available_locales = false

config.active_record.raise_in_transactional_callbacks = true
end
end
2 changes: 1 addition & 1 deletion config/environments/production.rb
Expand Up @@ -20,7 +20,7 @@
# config.action_dispatch.rack_cache = true

# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
config.serve_static_files = false

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Expand Up @@ -13,7 +13,7 @@
config.eager_load = false

# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"

# Show full error reports and disable caching.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/cookies_serializer.rb
@@ -0,0 +1 @@
Rails.application.config.action_dispatch.cookies_serializer = :hybrid

0 comments on commit ce8a0b2

Please sign in to comment.