Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - Gemfile - app/controllers/api/v1/search_controller.rb Conflict because we changed the number of default results to be configurable - app/lib/settings/scoped_settings.rb Addition of a new “noindex” site-wide setting, conflict due to our change of the two other site-wide settings (default flavour and skin instead of theme) - spec/controllers/application_controller_spec.rb Addition of a new “noindex” site-wide setting, conflict due to our change of the two other site-wide settings (default flavour and skin instead of theme)
This commit is contained in:
9
app/serializers/rest/featured_tag_serializer.rb
Normal file
9
app/serializers/rest/featured_tag_serializer.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::FeaturedTagSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :statuses_count, :last_status_at
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
end
|
13
app/serializers/rest/marker_serializer.rb
Normal file
13
app/serializers/rest/marker_serializer.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::MarkerSerializer < ActiveModel::Serializer
|
||||
attributes :last_read_id, :version, :updated_at
|
||||
|
||||
def last_read_id
|
||||
object.last_read_id.to_s
|
||||
end
|
||||
|
||||
def version
|
||||
object.lock_version
|
||||
end
|
||||
end
|
@@ -1,12 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::SearchSerializer < ActiveModel::Serializer
|
||||
attributes :hashtags
|
||||
|
||||
has_many :accounts, serializer: REST::AccountSerializer
|
||||
has_many :statuses, serializer: REST::StatusSerializer
|
||||
|
||||
def hashtags
|
||||
object.hashtags.map(&:name)
|
||||
end
|
||||
has_many :hashtags, serializer: REST::TagSerializer
|
||||
end
|
||||
|
@@ -1,7 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::V2::SearchSerializer < ActiveModel::Serializer
|
||||
has_many :accounts, serializer: REST::AccountSerializer
|
||||
has_many :statuses, serializer: REST::StatusSerializer
|
||||
has_many :hashtags, serializer: REST::TagSerializer
|
||||
end
|
Reference in New Issue
Block a user