Sha256: e19864124debf3675d90eeb483051cbafc046c7aa87d4a7418e268820f16a5fc

Contents?: true

Size: 466 Bytes

Versions: 5

Compression:

Stored size: 466 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

5 entries across 5 versions & 1 rubygems

Version Path
wlog-1.2.1 lib/wlog/commands/concat_description.rb
wlog-1.2.0 lib/wlog/commands/concat_description.rb
wlog-1.1.7 lib/wlog/commands/concat_description.rb
wlog-1.1.6 lib/wlog/commands/concat_description.rb
wlog-1.1.5 lib/wlog/commands/concat_description.rb