Module: Comments::Model

Extended by:
ActiveSupport::Concern
Included in:
Comment
Defined in:
lib/comments/model.rb

Constant Summary collapse

DEFAULT_AVATAR =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAMAAAAJixmgAAAAFVBMVEWkpKSnp6eqqqq3t7fS0tLV1dXZ2dmshcKEAAAAtklEQVR4Ae3XsRGAAAjAQFRk/5HtqaTz5H+DlInvAQAAAAAAAAAAAAAAAAAAAACymiveO6o7BQsWLFiwYMGCBS8PFixYsGDBggULFixYsGDBggULFixYsGDBggULFixYsGDBc4IFCxYsWLBgwYIFC14ZfOeAPRQ8IliwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQv+JQAAAAAAAAAAAAAAAAAAAOAB4KJfdHmj+kwAAAAASUVORK5CYII='

Instance Method Summary collapse

Instance Method Details

#can_reply?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/comments/model.rb', line 32

def can_reply?
  self.depth <= Comments.config.max_reply_depth
end

#user_avatar_urlObject



21
22
23
24
25
# File 'lib/comments/model.rb', line 21

def user_avatar_url
  return DEFAULT_AVATAR if Comments.config.user_avatar_url_method.blank?
  return DEFAULT_AVATAR if self.user.blank?
  self.user.send(Comments.config.user_avatar_url_method)
end

#user_nameObject



16
17
18
19
# File 'lib/comments/model.rb', line 16

def user_name
  return "" if self.user.blank?
  self.user.send(Comments.config.user_name_method)
end

#user_profile_urlObject



27
28
29
30
# File 'lib/comments/model.rb', line 27

def 
  return '#' if self.user.blank?
  self.user.send(Comments.config.)
end