Sha256: 63efcc2d28fc1d787647bfc15b1cce15b67f91e6c989d8911352090be55c1a5d

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

require 'gecko/record/base'

module Gecko
  module Record
    class User < Base
      attribute :first_name,         String
      attribute :last_name,          String
      attribute :email,              String,   readonly: true
      attribute :location,           String
      attribute :position,           String
      attribute :phone_number,       String
      attribute :mobile,             String
      attribute :last_sign_in_at,    DateTime, readonly: true
      attribute :avatar_url,         String,   readonly: true

      attribute :status,             String,   readonly: true
      attribute :billing_contact,    Boolean,  readonly: true

      # attribute :account_id,         Integer

      ## DEPRECATED
      attribute :mobile_phone,       String
    end

    class UserAdapter < BaseAdapter
      undef :build

      # Return the the logged in user
      #
      # @return [Gecko::Record::User]
      #
      # @api public
      def current
        if self.has_record_for_id?(:current)
          record_for_id(:current)
        else
          @identity_map[:current] = find(:current)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gecko-ruby-0.2.4 lib/gecko/record/user.rb
gecko-ruby-0.2.3 lib/gecko/record/user.rb
gecko-ruby-0.2.2 lib/gecko/record/user.rb
gecko-ruby-0.2.0 lib/gecko/record/user.rb