# encoding: utf-8
class SponzorskeDary < ActiveRecord::Base
  set_primary_key :ID_Dar
  set_table_name :sponzorske_dary
  
  belongs_to :podujatie, :foreign_key => 'ID_Podujatie', :class_name => Podujatium
  belongs_to :firmy, :foreign_key => 'ID_Firma', :class_name => Firmy
  
  belongs_to :c_stav_sponzor_dar, :foreign_key => 'ID_Stav_Dar', :class_name => CStavSponzorDar
  
  validates :Nazov, :ID_Stav_Dar, :ID_Podujatie, :ID_Firma, :presence => true
  
  validates_length_of :Nazov, :maximum => 50
  
end
