class MOdrTracker < ApplicationRecord
  belongs_to :m_odr
  
  
  
  before_create { generate_token() }
  
  def generate_token()
    begin
      self[:token] = SecureRandom.hex(2)
    end while MOdrRep.exists?(:token => self[:token])
  end
  
  
end
