Initial badge system implementation.

This commit is contained in:
Vikhyat Korrapati
2014-03-05 18:22:20 +05:30
parent 9eb3958374
commit 9b26c8584e
41 changed files with 1186 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
class BadgeSerializer < ApplicationSerializer
attributes :id, :name, :description
has_one :badge_type
end

View File

@@ -0,0 +1,3 @@
class BadgeTypeSerializer < ApplicationSerializer
attributes :id, :name, :color_hexcode
end

View File

@@ -0,0 +1,6 @@
class UserBadgeSerializer < ApplicationSerializer
attributes :id, :granted_at
has_one :badge
has_one :granted_by, serializer: BasicUserSerializer, root: :users
end