Sha256: cce8fa82d4f3d5509d6e12a664bda47d52565089922395dc64e4ddf2b5f78c19

Contents?: true

Size: 1.23 KB

Versions: 9

Compression:

Stored size: 1.23 KB

Contents

require 'authorization/v1/user'

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

  attributes :id
  attributes :email
  attributes :username
  attributes :fb_user_id
  attributes :password_digest
  attributes :created_at
  attributes :updated_at
  
  has_many :tokens
  

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

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

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

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

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

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

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

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

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
horse_power-1.0.0 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.9.0 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.8.5 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.8.3 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.8.2 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.8.1 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.8.0 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.7.1 lib/generators/horse_power/user/templates/serializer.rb.erb
horse_power-0.7.0 lib/generators/horse_power/user/templates/serializer.rb.erb