From a4dcabc11beac5e1226157baf4242ce66a831d55 Mon Sep 17 00:00:00 2001 From: Lain Iwakura Date: Tue, 14 Nov 2017 16:23:12 +0100 Subject: Return character limit in API and initial state. --- app/serializers/rest/instance_serializer.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/serializers/rest/instance_serializer.rb') diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb index 2898011fd..52c161cb4 100644 --- a/app/serializers/rest/instance_serializer.rb +++ b/app/serializers/rest/instance_serializer.rb @@ -4,7 +4,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer include RoutingHelper attributes :uri, :title, :description, :email, - :version, :urls, :stats, :thumbnail + :version, :urls, :stats, :thumbnail, :max_chars def uri Rails.configuration.x.local_domain @@ -30,6 +30,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer full_asset_url(instance_presenter.thumbnail.file.url) if instance_presenter.thumbnail end + def max_chars + StatusLengthValidator::MAX_CHARS + end + def stats { user_count: instance_presenter.user_count, -- cgit