Module: Freeberry::Models::Post::ClassMethods

Defined in:
lib/freeberry/models/post.rb

Class Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/freeberry/models/post.rb', line 11

def self.extended(base)
  base.send(:include, HeaderUtils)
  base.class_eval do
    belongs_to :structure
    has_many :comments, :as => :commentable, :dependent => :delete_all
    has_slug
    
    validates_presence_of :title, :content
	
   before_save :make_date
  end
end