Sha256: 9d57d550ee9849b0d5eb21733acf039dc85e671f167a68146519b2dcd1e88b1d

Contents?: true

Size: 350 Bytes

Versions: 19

Compression:

Stored size: 350 Bytes

Contents

module Rhoconnect
  class ApiToken < StoreOrm
    field :value,:string
    field :user_id,:string
    validates_presence_of :user_id

    def self.create(fields)
      fields[:value] = fields[:value] || get_random_identifier
      fields[:id] = fields[:value]
      super(fields)
    end

    def user
      User.load(self.user_id)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 lib/rhoconnect/api_token.rb
rhoconnect-7.5.1 lib/rhoconnect/api_token.rb
rhoconnect-7.4.1 lib/rhoconnect/api_token.rb
rhoconnect-7.1.17 lib/rhoconnect/api_token.rb
rhoconnect-6.2.0 lib/rhoconnect/api_token.rb
rhoconnect-6.0.11 lib/rhoconnect/api_token.rb
rhoconnect-5.5.18 lib/rhoconnect/api_token.rb
rhoconnect-5.5.17 lib/rhoconnect/api_token.rb
rhoconnect-5.5.15 lib/rhoconnect/api_token.rb
rhoconnect-5.5.0.22 lib/rhoconnect/api_token.rb
rhoconnect-5.5.2 lib/rhoconnect/api_token.rb
rhoconnect-5.5.0.7 lib/rhoconnect/api_token.rb
rhoconnect-5.5.0.3 lib/rhoconnect/api_token.rb
rhoconnect-5.5.0 lib/rhoconnect/api_token.rb
rhoconnect-5.1.1 lib/rhoconnect/api_token.rb
rhoconnect-4.0.4 lib/rhoconnect/api_token.rb
rhoconnect-4.0.3 lib/rhoconnect/api_token.rb
rhoconnect-4.0.2 lib/rhoconnect/api_token.rb
rhoconnect-4.0.1 lib/rhoconnect/api_token.rb