Sha256: a393ae15603f6226967c4f80639092b40d9b00722ab4b55efa96d93bd238714b

Contents?: true

Size: 1.13 KB

Versions: 21

Compression:

Stored size: 1.13 KB

Contents

require 'authorization'

module People
  class V1::UserSerializer < ActiveModel::Serializer
    embed :ids, include: true

    attributes :id
    attributes :username
    attributes :email
    attributes :created_at
    attributes :updated_at
    <% if options.arcadex? %>
    has_many :tokens
    <% end %>

    def include_id?
      return ::Authorization::People::V1::User.include_id?(current_user,object,@options)
    end

    def include_email?
      return ::Authorization::People::V1::User.include_email?(current_user,object,@options)
    end

    def include_username?
      return ::Authorization::People::V1::User.include_username?(current_user,object,@options)
    end

    def include_created_at?
      return ::Authorization::People::V1::User.include_created_at?(current_user,object,@options)
    end

    def include_updated_at?
      return ::Authorization::People::V1::User.include_updated_at?(current_user,object,@options)
    end

    def include_associations!
      <% if options.arcadex? %>
      include! :tokens if ::Authorization::People::V1::User.include_tokens?(current_user,object,@options)
      <% end %>
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
json_voorhees-1.0.0 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.5.5 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.5.4 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.5.3 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.5.2 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.5.1 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.5.0 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.9 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.8 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.7 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.6 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.5 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.4 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.3 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.2 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.1 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.4.0 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.3.9 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.3.6 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb
json_voorhees-0.3.5 lib/generators/json_voorhees/app_make_user/templates/user/user_serializer.rb