Sha256: 05b72f52831fa25761035b0e7f3d5c6c44b59e6e080640eb185f0f65f629e2fa

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 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
    
    has_many :tokens
    

    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!
      
      include! :tokens if ::Authorization::People::V1::User.include_tokens?(current_user,object,@options)
      
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arcadex-1.3.1 test/test_app/engines/people/app/serializers/people/v1/user_serializer.rb
arcadex-1.3.0 test/test_app/engines/people/app/serializers/people/v1/user_serializer.rb
arcadex-1.2.3 test/test_app/engines/people/app/serializers/people/v1/user_serializer.rb
arcadex-1.2.1 test/test_app/engines/people/app/serializers/people/v1/user_serializer.rb
arcadex-1.2.0 test/test_app/engines/people/app/serializers/people/v1/user_serializer.rb