Sha256: 58dadd70b0a4645fe4b8962d4334978296ea57c5c0c0a58bb4842434e9046deb
Contents?: true
Size: 389 Bytes
Versions: 31
Compression:
Stored size: 389 Bytes
Contents
require 'uuidtools' module Rhosync class ApiToken < Model field :value,:string field :user_id,:string validates_presence_of :user_id def self.create(fields) fields[:value] = fields[:value] || get_random_uuid fields[:id] = fields[:value] object = super(fields) end def user @user ||= User.load(self.user_id) end end end
Version data entries
31 entries across 31 versions & 1 rubygems