Commit 17e68d94 authored by dgt's avatar dgt Committed by azul
Browse files

Get rid of some deprecation warnings

parent 763a5c21
......@@ -101,7 +101,7 @@ class AccountsController < ApplicationController
user = User.find_by_email params[:email]
if user
token = User::Token.to_recover.create(user: user)
Mailer.forgot_password(token, mailer_options).deliver
Mailer.forgot_password(token, mailer_options).deliver_now
end
# this gives success even if there is no user, to not confirm that an email is in db
......@@ -120,7 +120,7 @@ class AccountsController < ApplicationController
@user.password = params[:new_password]
@user.password_confirmation = params[:password_confirmation]
if @user.save
Mailer.reset_password(@user, mailer_options).deliver
Mailer.reset_password(@user, mailer_options).deliver_now
@token.destroy
success :password_reset.t, :password_reset_ok_text.t, :nofade
redirect_to root_path
......
......@@ -14,7 +14,7 @@ module Asset::Upload
before_validation :process_attachment
after_update :finalize_attachment # \ both are
after_create :finalize_attachment # / needed
attribute :uploaded_data
attr_reader :uploaded_data
end
......
......@@ -304,7 +304,7 @@ class Group < ApplicationRecord
# if our name has changed, ensure that denormalized references
# to it also get changed
def update_name_copies
if name_changed? and !name_was.nil?
if saved_change_to_name? and !name_before_last_save.nil?
pages_owned.update_all(owner_name: name)
Wiki.clear_all_html(self) # in case there were links using the old name
# update all committees (this will also trigger the after_save of committees)
......
......@@ -110,7 +110,7 @@ class User < ApplicationRecord
after_save :update_name
def update_name
if login_changed? and !login_was.nil?
if saved_change_to_login? and !login_before_last_save.nil?
pages_owned.update_all(owner_name: login)
pages_created.update_all(created_by_login: login)
pages_updated.update_all(updated_by_login: login)
......
module User::Participation::History
def start_watching?
watch_changed? && watch == true
saved_change_to_watch? && watch == true
end
def stop_watching?
watch_changed? && watch != true
saved_change_to_watch? && watch != true
end
def star_added?
star_changed? && star == true
saved_change_to_star? && star == true
end
def star_removed?
star_changed? && star != true
saved_change_to_star? && star != true
end
def cleared_user_access?
access_changed? && access_sym.nil?
saved_change_to_access? && access_sym.nil?
end
end
......@@ -6,6 +6,6 @@ module User::Participation::Starring
end
def update_stars
page.update_star_count if page_id and star_changed?
page.update_star_count if page_id and saved_change_to_star?
end
end
......@@ -16,7 +16,7 @@ module Crabgrass
class Application < Rails::Application
info 'LOAD CONFIG BLOCK'
# config.load_defaults 5.1
# config.load_defaults 5.2
config.autoload_paths << "#{Rails.root}/lib"
config.autoload_paths << "#{Rails.root}/app/models"
......
......@@ -14,7 +14,7 @@ class AssetPage < Page
after_save :update_access
def update_access
asset.update_access if asset && public_changed?
asset.update_access if asset && saved_change_to_public?
end
def asset
......
......@@ -12,7 +12,7 @@ class Mailer::PgpKeyUploadTest < ActionMailer::TestCase
def test_forever_key
user = users(:blue)
mail = mailer_class.key_uploaded_mail(user).deliver
mail = mailer_class.key_uploaded_mail(user).deliver_now
assert_includes mail.body, 'You just uploaded a new key'
assert mailer_class.deliveries.present?
assert mailer_class.deliveries.first.encrypted?
......@@ -20,7 +20,7 @@ class Mailer::PgpKeyUploadTest < ActionMailer::TestCase
def test_valid_to_2050_key
user = users(:dolphin)
mail = mailer_class.key_uploaded_mail(user).deliver
mail = mailer_class.key_uploaded_mail(user).deliver_now
assert_includes mail.body, 'You just uploaded a new key'
assert mailer_class.deliveries.present?
assert mailer_class.deliveries.first.encrypted?
......@@ -30,7 +30,7 @@ class Mailer::PgpKeyUploadTest < ActionMailer::TestCase
def test_expired_key
user = users(:green)
assert_raises Mail::Gpg::MissingKeysError do
mail = mailer_class.key_uploaded_mail(user).deliver
mail = mailer_class.key_uploaded_mail(user).deliver_now
end
end
......@@ -39,7 +39,7 @@ class Mailer::PgpKeyUploadTest < ActionMailer::TestCase
def test_broken_key
user = users(:red)
assert_raises Mail::Gpg::MissingKeysError do
mail = mailer_class.key_uploaded_mail(user).deliver
mail = mailer_class.key_uploaded_mail(user).deliver_now
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment