Class: Storytime::Blog

Inherits:
Page
  • Object
show all
Defined in:
app/models/storytime/blog.rb

Instance Attribute Summary

Attributes inherited from Post

#preview

Class Method Summary collapse

Methods inherited from Page

#show_comments?

Methods inherited from Post

#author_name, find_preview, human_name, #human_name, #normalize_friendly_id, policy_class, #post_ancestor_klasses, #preview_content, #sanitize_content, #should_generate_new_friendly_id?, #slug_candidates, #to_partial_path, type_name, #type_name

Methods included from Concerns::HasVersions

#activate_version, #create_version, #draft_content, #latest_version, #publish!, #published, #published=, #published?

Class Method Details

.seed(site, user) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/models/storytime/blog.rb', line 5

def self.seed(site, user)
  blog = site.blogs.new
  blog.title = "Blog"
  blog.slug = "blog"
  blog.published_at = Time.now
  blog.user = user
  blog.save
  blog
end