# -*- encoding : utf-8 -*- class Newsletter < ActiveRecord::Base validates_presence_of :title has_one :block, :as => :blockable after_create :after_creation def after_creation @block = Block.new(:block_name => "Contenu") @block.blockable = self @block.save end def alloweds_types self.block.allow_types :TitleContent, :TextContent, :ImageContent, :LinkContent, :GalleryContent, :HtmlContent, :DownloadContent end #attr_accessible :title, :content, :email_from #EMAIL_FROMS=["Le Pic Vert ", "Le Pic Vert "] end