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