Sha256: dee87eced21a6bfad31207f741085c67cf019e44cf7c8e5cbcbee68862eb6c7f

Contents?: true

Size: 658 Bytes

Versions: 16

Compression:

Stored size: 658 Bytes

Contents

module Ecom
  module Core
    class LookaheadPlanTaskProgress < ApplicationRecord
      belongs_to :lookahead_plan
      belongs_to :task

      validates :lookahead_plan_id, :lookahead_plan, :task_id, :task, :started_on, :ended_on,
                :lookahead_plan_revision_number, presence: true

      validates_numericality_of :lookahead_plan_revision_number,
                                greater_than_or_equal_to: 0

      validate :date_range_validator

      def date_range_validator
        return unless started_on && ended_on && started_on > ended_on

        errors.add(:base, 'Ended on cannot be before started on')
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ecom_core-1.3.14 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.13 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.12 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.11 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.10 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.9 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.8 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.7 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.6 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.5 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.4 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.3 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.2 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.1 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.3.0 app/models/ecom/core/lookahead_plan_task_progress.rb
ecom_core-1.2.36 app/models/ecom/core/lookahead_plan_task_progress.rb