Class: Blog::Post
- Inherits:
-
Wheelhouse::Resource
- Object
- Wheelhouse::Resource
- Blog::Post
- Includes:
- Wheelhouse::Resource::Content, Wheelhouse::Resource::Renderable, Wheelhouse::Resource::Versioned
- Defined in:
- app/models/blog/post.rb
Instance Method Summary collapse
- #admin_path ⇒ Object
- #author ⇒ Object
- #author_name ⇒ Object
- #handler ⇒ Object
- #path ⇒ Object
- #published? ⇒ Boolean
- #published_at ⇒ Object
Instance Method Details
#admin_path ⇒ Object
69 70 71 |
# File 'app/models/blog/post.rb', line 69 def admin_path persisted? ? blog_post_path(blog_id, self) : blog_posts_path(blog_id) end |
#author ⇒ Object
61 62 63 |
# File 'app/models/blog/post.rb', line 61 def created_by end |
#author_name ⇒ Object
57 58 59 |
# File 'app/models/blog/post.rb', line 57 def read_attribute(:author_name) || ( && .name) end |
#handler ⇒ Object
73 74 75 |
# File 'app/models/blog/post.rb', line 73 def handler Blog::PostHandler end |
#path ⇒ Object
53 54 55 |
# File 'app/models/blog/post.rb', line 53 def path blog.path(published_at.year, published_at.month, permalink) end |
#published? ⇒ Boolean
49 50 51 |
# File 'app/models/blog/post.rb', line 49 def published? state == 'Published' end |
#published_at ⇒ Object
65 66 67 |
# File 'app/models/blog/post.rb', line 65 def published_at read_attribute(:published_at) || Time.now end |