require 'authorization' module <%= module_camel %> class <%= 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 %>::<%= resource_camel %>.include_id?(current_user,object,@options) end def include_associations! #include! :bulletin if ::Authorization::<%= module_camel %>::<%= resource_camel %>.include_bulletin?(current_user,object,@options) #include! :posts if ::Authorization::<%= module_camel %>::<%= resource_camel %>.include_posts?(current_user,object,@options) end end end