Sha256: db0f268109712497dca84951bba1e093460e9a9c1735903cafa3392b6fc97e24

Contents?: true

Size: 465 Bytes

Versions: 1

Compression:

Stored size: 465 Bytes

Contents

require 'wlog/commands/commandable'
require 'wlog/domain/log_entry'

module Wlog
# Concatenate a string to an existing log entry
class ConcatDescription < Commandable
  def initialize(id, str)
    @id, @str = id, str
  end

  # Find and update the log entry
  def execute
    log_entry = LogEntry.find(@id)
    log_entry.description += @str
    log_entry.save
  rescue ActiveRecord::RecordNotFound
    false
  end

  attr_reader :id, :str
end
end # end Wlog module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wlog-1.2.2 lib/wlog/commands/concat_description.rb