Sha256: 7c350ac637446f725e838e5852e4d0fa300c524dff322e8531a4378a7724a4fb
Contents?: true
Size: 471 Bytes
Versions: 7
Compression:
Stored size: 471 Bytes
Contents
module Arcadex class Token < ActiveRecord::Base before_validation :generate_hash, on: :create belongs_to :imageable, :polymorphic => true validates :imageable_id, presence: true validates :imageable_type, presence: true validates :auth_token, presence: true #This also happens at the database level validates :auth_token, uniqueness: true def generate_hash self.auth_token = ::Arcadex::Create.generate_auth_token end end end
Version data entries
7 entries across 7 versions & 1 rubygems