Class: Kublog::Post
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Kublog::Post
- Extended by:
- FriendlyId
- Defined in:
- app/models/kublog/post.rb
Instance Method Summary collapse
- #author ⇒ Object
- #related_posts ⇒ Object
- #to_s ⇒ Object
-
#url ⇒ Object
Public Access to the Post.
Instance Method Details
#author ⇒ Object
23 24 25 |
# File 'app/models/kublog/post.rb', line 23 def user.to_s end |
#related_posts ⇒ Object
38 39 40 41 42 |
# File 'app/models/kublog/post.rb', line 38 def unless self.category.nil? self.category.posts.where('id != ?', self.id) end end |
#to_s ⇒ Object
27 28 29 |
# File 'app/models/kublog/post.rb', line 27 def to_s title end |
#url ⇒ Object
Public Access to the Post
32 33 34 35 36 |
# File 'app/models/kublog/post.rb', line 32 def url unless new_record? Engine.routes.url_helpers.quickie_url(self, :host => Kublog.[:host]) end end |