JSONApi progress
This commit is contained in:
@@ -4,6 +4,7 @@ module Qwaiter
|
||||
extend ActiveSupport::Autoload
|
||||
autoload :Distribution
|
||||
autoload :Serializer
|
||||
autoload :UserBaseSerializer
|
||||
autoload :Counter
|
||||
autoload :Broadcaster
|
||||
autoload :Couchbase
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
class Qwaiter::UserBaseSerializer
|
||||
include JSONAPI::Serializer
|
||||
|
||||
def base_url
|
||||
"/user"
|
||||
end
|
||||
|
||||
def format_name(attribute_name)
|
||||
#attribute_name.to_s.dasherize
|
||||
attribute_name.to_s
|
||||
end
|
||||
|
||||
def unformat_name(attribute_name)
|
||||
#attribute_name.to_s.underscore
|
||||
attribute_name.to_s
|
||||
end
|
||||
|
||||
def relationship_related_link(attribute_name)
|
||||
super
|
||||
end
|
||||
|
||||
def relationship_self_link(attribute_name)
|
||||
end
|
||||
|
||||
def self.attributes(*attrs)
|
||||
attrs.each do |attr|
|
||||
attribute attr
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user