Sha256: 4e59933eb0b26afb93c33888b00d63c88d746348c41fcf63e7b4c00327be17d8

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

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

module Wlog
# Command to create a log entry given an issue id, and a string
# @author Simon Symeonidis
class NewEntry < Commandable

  def initialize(desc, issue)
    @desc, @issue = desc, issue
  end

  def execute
    log_entry = LogEntry.new(
      :description => @desc,
      :created_at => DateTime.now,
      :updated_at => DateTime.now)

    @issue.log_entries << log_entry
  end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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