2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-07-31 11:18:50 -04:00
|
|
|
class AuthProviderSerializer < ApplicationSerializer
|
|
|
|
|
2021-03-25 09:23:48 -04:00
|
|
|
attributes :name, :custom_url, :pretty_name_override, :title_override,
|
2019-10-08 07:10:43 -04:00
|
|
|
:frame_width, :frame_height, :can_connect, :can_revoke,
|
2019-03-27 09:25:04 -04:00
|
|
|
:icon
|
2018-07-31 11:18:50 -04:00
|
|
|
|
|
|
|
def title_override
|
2019-05-06 21:00:09 -04:00
|
|
|
return SiteSetting.get(object.title_setting) if object.title_setting
|
2018-07-31 11:18:50 -04:00
|
|
|
object.title
|
|
|
|
end
|
|
|
|
|
|
|
|
def pretty_name_override
|
2019-05-06 21:00:09 -04:00
|
|
|
return SiteSetting.get(object.pretty_name_setting) if object.pretty_name_setting
|
2018-07-31 11:18:50 -04:00
|
|
|
object.pretty_name
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|