# encoding: utf-8
class Videa < ActiveRecord::Base
  set_primary_key :ID_Video
  set_table_name :videa
  
  belongs_to :klienti, :foreign_key => 'ID_Klient', :class_name => Klienti
  
  validates :Datum_Vlozenia, :Nazov_Suboru, :ID_Klient, :presence => true
  validates :Nazov_Suboru, :format => {
      :with => %r{\.(avi|)$}i,
      :message => 'Je možné vložiť súbor typu .avi!'
    }
    
  validates_length_of :Popis, :maximum => 50
  validates_length_of :Nazov_Suboru, :maximum => 40
end
