Sha256: 5fa54d291756a1ce1cffd8666f3fe0d079f18dd4fcd767445e095b5c6f8e2848

Contents?: true

Size: 744 Bytes

Versions: 1

Compression:

Stored size: 744 Bytes

Contents

require 'active_record'

require 'wlog/domain/helpers'
require 'wlog/domain/attachment'
require 'wlog/tech/text_filters'

module Wlog
# Author :: Simon Symeonidis
#  Active Record Domain object for a log entry
class LogEntry < ActiveRecord::Base
  include TextFilters

  belongs_to :issue

  # Print things nicely formmated no more than 80 cars (well, unless you stick
  # the time in the end which is not counted for).
  def to_s
    str    = "[#{id}] "
    tmp    = "#{description} [#{created_at.strftime("%H:%M:%S")}]"
    desc   = Helpers.break_string(tmp,80)
    indent = " " * (id.to_s.split('').count + 5)
    desc.gsub!(/#{$/}/, "#{$/}#{indent}")
    str.concat(desc)
    highlight_hyperlink_s(str)
  end

private
end
end # module Wlog

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wlog-1.2.2 lib/wlog/domain/log_entry.rb