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