mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Initial badge system implementation.
This commit is contained in:
5
app/serializers/badge_serializer.rb
Normal file
5
app/serializers/badge_serializer.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class BadgeSerializer < ApplicationSerializer
|
||||
attributes :id, :name, :description
|
||||
|
||||
has_one :badge_type
|
||||
end
|
||||
3
app/serializers/badge_type_serializer.rb
Normal file
3
app/serializers/badge_type_serializer.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class BadgeTypeSerializer < ApplicationSerializer
|
||||
attributes :id, :name, :color_hexcode
|
||||
end
|
||||
6
app/serializers/user_badge_serializer.rb
Normal file
6
app/serializers/user_badge_serializer.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class UserBadgeSerializer < ApplicationSerializer
|
||||
attributes :id, :granted_at
|
||||
|
||||
has_one :badge
|
||||
has_one :granted_by, serializer: BasicUserSerializer, root: :users
|
||||
end
|
||||
Reference in New Issue
Block a user