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