Class: Fuel::Author

Inherits:
ActiveRecord::Base
  • Object
show all
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_urlObject



34
35
36
# File 'app/models/fuel/author.rb', line 34

def avatar_url
  avatar_file_name.present? ? avatar.url(:medium) : nil
end

#full_nameObject



13
14
15
# File 'app/models/fuel/author.rb', line 13

def full_name
  [first_name, last_name].compact.join(" ")
end


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_credentialsObject



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