Sha256: dbd423793aace08a07ff8801be5eb3225fe73451f33b92ef2e80105fce58b955

Contents?: true

Size: 457 Bytes

Versions: 4

Compression:

Stored size: 457 Bytes

Contents

module Ecom
  module Core
    class Plan < ApplicationRecord
      NEW = 'New'.freeze
      READY_TO_START = 'Ready to start'.freeze
      IN_PROGRESS = 'In Progress'.freeze
      COMPLETED = 'Completed'.freeze

      STATUSES = [NEW, READY_TO_START, IN_PROGRESS, COMPLETED].freeze

      validates :name, :start_date, :end_date, :status, presence: true

      validates :status, presence: true, inclusion: STATUSES

      has_many :tasks
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ecom_core-1.2.35 app/models/ecom/core/plan.rb
ecom_core-1.2.34 app/models/ecom/core/plan.rb
ecom_core-1.2.33 app/models/ecom/core/plan.rb
ecom_core-1.2.32 app/models/ecom/core/plan.rb