Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
gab
social
gab-social
Commits
0499184b
Commit
0499184b
authored
Aug 31, 2019
by
2458773093
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added active promoted statuses to initial state
parent
044e9695
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
app/serializers/initial_state_serializer.rb
app/serializers/initial_state_serializer.rb
+6
-1
app/serializers/rest/promotion_serializer.rb
app/serializers/rest/promotion_serializer.rb
+5
-0
No files found.
app/serializers/initial_state_serializer.rb
View file @
0499184b
...
...
@@ -2,7 +2,8 @@
class
InitialStateSerializer
<
ActiveModel
::
Serializer
attributes
:meta
,
:compose
,
:accounts
,
:media_attachments
,
:settings
:media_attachments
,
:settings
,
:promotions
has_one
:push_subscription
,
serializer:
REST
::
WebPushSubscriptionSerializer
...
...
@@ -65,6 +66,10 @@ class InitialStateSerializer < ActiveModel::Serializer
{
accept_content_types:
MediaAttachment
::
IMAGE_FILE_EXTENSIONS
+
MediaAttachment
::
VIDEO_FILE_EXTENSIONS
+
MediaAttachment
::
IMAGE_MIME_TYPES
+
MediaAttachment
::
VIDEO_MIME_TYPES
}
end
def
promotions
ActiveModelSerializers
::
SerializableResource
.
new
(
Promotion
.
active
,
each_serializer:
REST
::
PromotionSerializer
)
end
private
def
instance_presenter
...
...
app/serializers/rest/promotion_serializer.rb
0 → 100644
View file @
0499184b
# frozen_string_literal: true
class
REST
::
PromotionSerializer
<
ActiveModel
::
Serializer
attributes
:status_id
,
:timeline_id
,
:position
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment