Sha256: e6e2b867645c6ecb1e06a4e2df69f5c1e6be56fcf2e08449042b79d392f005ef
Contents?: true
Size: 714 Bytes
Versions: 10
Compression:
Stored size: 714 Bytes
Contents
module VotesControllerBaseClass extend ActiveSupport::Concern included do controller do rescue_from Neutral::Errors::RequireLogin, with: :require_login rescue_from Neutral::Errors::CannotChange, with: :cannot_change rescue_from Neutral::Errors::DuplicateVote, with: :duplicate def current_voter send Neutral.config.current_voter_method end private def require_login render 'neutral/votes/errors/require_login', status: 401 end def cannot_change render 'neutral/votes/errors/cannot_change', status: 403 end def duplicate render 'neutral/votes/errors/duplicate', status: 409 end end end end
Version data entries
10 entries across 10 versions & 1 rubygems