discourse/app/serializers/auth_provider_serializer.rb
Sam Saffron 30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00

30 lines
801 B
Ruby

# frozen_string_literal: true
class AuthProviderSerializer < ApplicationSerializer
attributes :name, :custom_url, :pretty_name_override, :title_override, :message_override,
:frame_width, :frame_height, :full_screen_login, :can_connect, :can_revoke,
:icon
def title_override
return SiteSetting.get(object.title_setting) if object.title_setting
object.title
end
def pretty_name_override
return SiteSetting.get(object.pretty_name_setting) if object.pretty_name_setting
object.pretty_name
end
def full_screen_login
return SiteSetting.get(object.full_screen_login_setting) if object.full_screen_login_setting
return object.full_screen_login if object.full_screen_login
false
end
def message_override
object.message
end
end