jfn_app/app/models/actuality.rb
Nicolas Bally 0d62fbe429 initial
2011-12-29 11:06:37 +01:00

22 lines
351 B
Ruby

class Actuality < ActiveRecord::Base
belongs_to :image_file
validates :title, :presence => true
has_one :block, :as => :blockable
after_create do
@block = Block.new(:block_name => "general")
@block.blockable = self
@block.save
ContentType.all.each do |content_type|
@block.content_types << content_type
end
end
end