Sha256: 65c2fdda146a3665327733b3b0f95355c75e867d32ff431fe8f7ac3d611e82f2
Contents?: true
Size: 1.46 KB
Versions: 17
Compression:
Stored size: 1.46 KB
Contents
require 'authorization' module <%= module_camel %> class V<%= api_version %>::<%= resource_camel %>Serializer < ActiveModel::Serializer embed :ids, include: true attributes :id <% attributes.each do |pair| %> attributes :<%= pair.split(/:/)[0] %> <% end %> attributes :created_at attributes :updated_at #has_one :bulletin #has_many :posts def include_id? return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_id?(current_user,object,@options) end <% attributes.each do |pair| %> def include_<%= pair.split(/:/)[0] %>? return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_created_at?(current_user,object,@options) end <% end %> def include_created_at? return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_created_at?(current_user,object,@options) end def include_updated_at? return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_updated_at?(current_user,object,@options) end def include_associations! #include! :bulletin if ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_bulletin?(current_user,object,@options) #include! :posts if ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_posts?(current_user,object,@options) end end end
Version data entries
17 entries across 17 versions & 1 rubygems