2014-11-26 12:56:12 -06:00
|
|
|
require_dependency 'admin_user_list_serializer'
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2014-11-26 12:56:12 -06:00
|
|
|
class AdminUserSerializer < AdminUserListSerializer
|
|
|
|
|
|
|
|
attributes :associated_accounts,
|
2013-05-07 20:58:34 -05:00
|
|
|
:can_send_activation_email,
|
|
|
|
:can_activate,
|
2015-01-06 10:06:05 -06:00
|
|
|
:can_deactivate,
|
2014-11-26 12:56:12 -06:00
|
|
|
:ip_address,
|
|
|
|
:registration_ip_address,
|
|
|
|
:can_send_activation_email
|
2013-10-03 22:28:49 -05:00
|
|
|
|
2014-08-22 19:34:48 -05:00
|
|
|
has_one :single_sign_on_record, serializer: SingleSignOnRecordSerializer, embed: :objects
|
|
|
|
|
2013-05-07 20:58:34 -05:00
|
|
|
def can_send_activation_email
|
|
|
|
scope.can_send_activation_email?(object)
|
|
|
|
end
|
|
|
|
|
|
|
|
def can_activate
|
|
|
|
scope.can_activate?(object)
|
|
|
|
end
|
|
|
|
|
|
|
|
def can_deactivate
|
|
|
|
scope.can_deactivate?(object)
|
|
|
|
end
|
|
|
|
|
2013-11-05 14:00:47 -06:00
|
|
|
def ip_address
|
|
|
|
object.ip_address.try(:to_s)
|
|
|
|
end
|
|
|
|
|
2014-04-29 13:37:56 -05:00
|
|
|
def registration_ip_address
|
|
|
|
object.registration_ip_address.try(:to_s)
|
|
|
|
end
|
|
|
|
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|