class Sejour < ActiveRecord::Base

  
  belongs_to :image_file
  
  has_many :saison_sejours
  has_many :saisons, :through => :saison_sejours
has_one :block, :as => :blockable
  has_many :sejour_dates

  accepts_nested_attributes_for :sejour_dates, :allow_destroy => true


	after_create do
	    @block = Block.new(:block_name => "Contenu")
		@block.blockable = self
		@block.save
		
		
	end
  
  
end
