Sha256: ad6f01adc090667572b9893c753ff8d1a35e862cffb572c3514c2a43344a5bff

Contents?: true

Size: 344 Bytes

Versions: 2

Compression:

Stored size: 344 Bytes

Contents

class ReRuleExpectedOutcome < ActiveRecord::Base
  belongs_to :re_rule

  validates_associated  :re_rule
  validates_presence_of :outcome  

  def validate    
    if outcome == RulesEngine::Rule::Outcome::START_WORKFLOW && workflow_code.blank?
      errors.add(:workflow_code, "workflow code required")
    else
      true  
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rules_engine-0.1.6 rails_generators/templates/app/models/re_rule_expected_outcome.rb
rules_engine-0.1.5 rails_generators/templates/app/models/re_rule_expected_outcome.rb