diff --git a/app/controllers/dmails_controller.rb b/app/controllers/dmails_controller.rb index c57f2ab82..b68033e82 100644 --- a/app/controllers/dmails_controller.rb +++ b/app/controllers/dmails_controller.rb @@ -53,7 +53,8 @@ class DmailsController < ApplicationController Dmail.visible.unread.each do |x| x.update_column(:is_read, true) end - CurrentUser.user.update_column(:has_mail, false) + CurrentUser.user.has_mail = false + CurrentUser.user.save end private diff --git a/app/models/user.rb b/app/models/user.rb index d99048601..5d44602be 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -75,7 +75,8 @@ class User < ActiveRecord::Base end def unban! - update_column(:is_banned, false) + self.is_banned = false + save ban.destroy end end