Module: Sunrise::Models::Post::ClassMethods

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

Class Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



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

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