Sha256: a6e4c9533e92de6ad50e821cc3678f1c95992f45516e7cf614402d68411af8d6

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 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
      attribute :account_name,       String

      ## 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

9 entries across 9 versions & 1 rubygems

Version Path
gecko-ruby-0.9.1 lib/gecko/record/user.rb
gecko-ruby-0.9.0 lib/gecko/record/user.rb
gecko-ruby-0.8.0 lib/gecko/record/user.rb
gecko-ruby-0.2.6 lib/gecko/record/user.rb
gecko-ruby-0.7.1 lib/gecko/record/user.rb
gecko-ruby-0.7.0 lib/gecko/record/user.rb
gecko-ruby-0.6.0 lib/gecko/record/user.rb
gecko-ruby-0.5.0 lib/gecko/record/user.rb
gecko-ruby-0.2.5 lib/gecko/record/user.rb