Module: Comments::Model
Constant Summary collapse
- DEFAULT_AVATAR =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAMAAAAJixmgAAAAFVBMVEWkpKSnp6eqqqq3t7fS0tLV1dXZ2dmshcKEAAAAtklEQVR4Ae3XsRGAAAjAQFRk/5HtqaTz5H+DlInvAQAAAAAAAAAAAAAAAAAAAACymiveO6o7BQsWLFiwYMGCBS8PFixYsGDBggULFixYsGDBggULFixYsGDBggULFixYsGDBc4IFCxYsWLBgwYIFC14ZfOeAPRQ8IliwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQv+JQAAAAAAAAAAAAAAAAAAAOAB4KJfdHmj+kwAAAAASUVORK5CYII='
Instance Method Summary collapse
Instance Method Details
#can_reply? ⇒ Boolean
32 33 34 |
# File 'lib/comments/model.rb', line 32 def can_reply? self.depth <= Comments.config.max_reply_depth end |
#user_avatar_url ⇒ Object
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_name ⇒ Object
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_url ⇒ Object
27 28 29 30 |
# File 'lib/comments/model.rb', line 27 def user_profile_url return '#' if self.user.blank? self.user.send(Comments.config.user_profile_url_method) end |