Sha256: 6a31d1edad9c37ba1e230948d1da10cc811dfb8c6bcf0545437c0a1872a21bb4

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

class Comment < ActiveRecord::Base
  include TheComments::Comment
  # ---------------------------------------------------
  # Define comment's avatar url
  # Usually we use Comment#user (owner of comment) to define avatar
  # @blog.comments.includes(:user) <= use includes(:user) to decrease queries count
  # comment#user.avatar_url
  # ---------------------------------------------------

  # public
  # ---------------------------------------------------
  # Simple way to define avatar url
  #
  # def avatar_url
  #   src = id.to_s
  #   src = title unless title.blank?
  #   src = contacts if !contacts.blank? && /@/ =~ contacts
  #   hash = Digest::MD5.hexdigest(src)
  #   "https://2.gravatar.com/avatar/#{hash}?s=42&d=https://identicons.github.com/#{hash}.png"
  # end
  # ---------------------------------------------------

  # private
  # ---------------------------------------------------
  # Define your content filters
  # gem 'RedCloth'
  # gem 'sanitize'
  # gem 'MySmilesProcessor'
  #
  # def prepare_content
  #   text = self.raw_content
  #   text = RedCloth.new(text).to_html
  #   text = MySmilesProcessor.new(text)
  #   text = Sanitize.clean(text, Sanitize::Config::RELAXED)
  #   self.content = text
  # end
  # ---------------------------------------------------
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
fuck_comments-2.3.4 app/models/_templates_/comment.rb
the_comments_ruby-2.3.4 app/models/_templates_/comment.rb
the_comments_ruby-2.3.3 app/models/_templates_/comment.rb
the_comments-2.3.1 app/models/_templates_/comment.rb
the_comments-2.2.2 app/models/_templates_/comment.rb
the_comments-2.2.1 app/models/_templates_/comment.rb
the_comments-2.2.0 app/models/_templates_/comment.rb
the_comments-2.1.0 app/models/_templates_/comment.rb
the_comments-2.0.1 app/models/_templates_/comment.rb
the_comments-2.0.0 app/models/_templates_/comment.rb