fix-time_entry-initialization.diff

Nobuhiro IMAI, 2008-06-13 17:58

Download (517 Bytes)

View differences:

app/models/time_entry.rb (working copy)
30 30
  validates_length_of :comments, :maximum => 255
31 31

  
32 32
  def after_initialize
33
    if new_record?
34
      self.activity ||= Enumeration.default('ACTI')
33
    if new_record? && !self.activity
34
      if activity = Enumeration.default('ACTI')
35
        self.activity_id ||= activity.id
36
      end
35 37
    end
36 38
  end
37 39