Sha256: 6a7d4713faa665a54417bc3adc7eb30ed06f6b8d4b6ebe5215d39f301466917a
Contents?: true
Size: 1.43 KB
Versions: 16
Compression:
Stored size: 1.43 KB
Contents
require 'authorization' module <%= module_camel %> class V<%= api_version %>::<%= resource_camel %>Serializer < ActiveModel::Serializer embed :ids, include: true attributes :id 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] %>?(current_user,<%= resource_singular %>_object,options) 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
16 entries across 16 versions & 1 rubygems