Class: Statixite::Post

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
app/models/statixite/post.rb

Instance Method Summary collapse

Instance Method Details

#post_pathnameObject



20
21
22
# File 'app/models/statixite/post.rb', line 20

def post_pathname
  Rails.root.join(site.site_posts_path, self.filename)
end

#write_slugObject



24
25
26
# File 'app/models/statixite/post.rb', line 24

def write_slug
  self.slug = append_suffix(self.title.parameterize)
end

#write_to_tmp(env = 'preview') ⇒ Object



15
16
17
18
# File 'app/models/statixite/post.rb', line 15

def write_to_tmp(env='preview')
  FileUtils.mkdir_p(site.site_posts_path)
  write_content
end