Sha256: 25186e28bf5b6e2e8afbc32daadaf2fbd4b29221f0d3932301af1372b4502e7e
Contents?: true
Size: 494 Bytes
Versions: 4
Compression:
Stored size: 494 Bytes
Contents
class FindCurrentUserService < Aldous::Service attr_reader :session def initialize(session) @session = session end def raisable_error Aldous::Errors::UserError end def default_result_data {user: nil} end def perform user_id = session[:user_id] if user_id user = User.where(id: user_id).first if user Result::Success.new(user: user) else Result::Failure.new end else Result::Failure.new end end end
Version data entries
4 entries across 4 versions & 1 rubygems