Class: RailsBlogEngine::Post
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RailsBlogEngine::Post
- Defined in:
- app/models/rails_blog_engine/post.rb
Class Method Summary collapse
-
.author_byline(author) ⇒ Object
Try to generate a reasonable byline for an author.
Class Method Details
.author_byline(author) ⇒ Object
Try to generate a reasonable byline for an author. We use a author.byline
method if present, and default to author.email
stripped of its domain.
61 62 63 64 65 66 67 68 69 70 |
# File 'app/models/rails_blog_engine/post.rb', line 61 def () case when .respond_to?(:byline) && . . when .respond_to?(:email) && .email .email.sub(/@.*\z/, '') else 'unknown' end end |