Class: Fuel::Author
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Fuel::Author
- Defined in:
- app/models/fuel/author.rb
Constant Summary collapse
- KEYS =
[:first_name, :last_name, :title, :bio, :avatar, :email, :twitter, :github, :dribbble, :instagram, :medium, :personal_site, :linkedin, :start_date, :is_active].freeze
Instance Method Summary collapse
Instance Method Details
#avatar_url ⇒ Object
34 35 36 |
# File 'app/models/fuel/author.rb', line 34 def avatar_url avatar_file_name.present? ? avatar.url(:medium) : nil end |
#full_name ⇒ Object
13 14 15 |
# File 'app/models/fuel/author.rb', line 13 def full_name [first_name, last_name].compact.join(" ") end |
#other_posts(post_id) ⇒ Object
30 31 32 |
# File 'app/models/fuel/author.rb', line 30 def other_posts(post_id) @other_posts ||= posts.published.recent.where.not(id: post_id) end |
#s3_credentials ⇒ Object
26 27 28 |
# File 'app/models/fuel/author.rb', line 26 def s3_credentials {:bucket => Fuel.configuration.aws_bucket, :access_key_id => Fuel.configuration.aws_access_key, :secret_access_key => Fuel.configuration.aws_secret_access_key} end |