Module: Decidim::UserBlockedChecker

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
app/controllers/concerns/decidim/user_blocked_checker.rb

Instance Method Summary collapse

Instance Method Details

#check_user_block_status(user) ⇒ Object



17
18
19
20
21
22
23
24
# File 'app/controllers/concerns/decidim/user_blocked_checker.rb', line 17

def check_user_block_status(user)
  if user.present? && user.blocked?
    sign_out user
    flash.delete(:notice)
    flash[:error] = t("decidim.account.blocked")
    root_path
  end
end

#check_user_not_blockedObject



13
14
15
# File 'app/controllers/concerns/decidim/user_blocked_checker.rb', line 13

def check_user_not_blocked
  check_user_block_status(current_user)
end