maisonarbre_app/app/models/newsletter.rb
Nicolas Bally 1fa250e0e4 Initial
2011-07-15 12:29:09 +02:00

18 lines
321 B
Ruby

class Newsletter < ActiveRecord::Base
after_create :after_creation
has_one :block, :as => :blockable
def after_creation
@block = Block.new(:block_name => "Contenu")
@block.blockable = self
@block.save
ContentType.all.each do |content_type|
@block.content_types << content_type
end
end
end