Sha256: 032b5ac3cae3cf3de849fff4d8d85bff752273dab5f7effbfab9381c9e084d5a

Contents?: true

Size: 404 Bytes

Versions: 20

Compression:

Stored size: 404 Bytes

Contents

class Issue < ActiveRecord::Base
  belongs_to :person

  validates_presence_of :subject
  validate :dummy_validation

  def validation_log
    @validation_log ||= []
  end

  def log(validation_line)
    validation_log << validation_line
    validation_log
  end

  def dummy_validation
    if new_record?
      log("Validating new issue")
    else
      log("Validating issue #{id}")
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
deferring-0.8.2 spec/support/models/issue.rb
deferring-0.8.1 spec/support/models/issue.rb
deferring-0.8.0 spec/support/models/issue.rb
deferring-0.7.1 spec/support/models/issue.rb
deferring-0.7.0 spec/support/models/issue.rb
deferring-0.6.2 spec/support/models/issue.rb
deferring-0.6.1 spec/support/models/issue.rb
deferring-0.6.0 spec/support/models/issue.rb
deferring-0.5.0 spec/support/models/issue.rb
deferring-0.4.1 spec/support/models/issue.rb
deferring-0.4.0 spec/support/models/issue.rb
deferring-0.3.0 spec/support/models/issue.rb
deferring-0.2.1 spec/support/models/issue.rb
deferring-0.2.0 spec/support/models/issue.rb
deferring-0.1.5 spec/support/models/issue.rb
deferring-0.1.4 spec/support/models/issue.rb
deferring-0.1.3 spec/support/models/issue.rb
deferring-0.1.2 spec/support/models/issue.rb
deferring-0.1.1 spec/support/models/issue.rb
deferring-0.1.0 spec/support/models/issue.rb