Sha256: 349415f43981052198d37fb78b146f86fae99b8c80fc757b0791f3b487e6f1dc

Contents?: true

Size: 394 Bytes

Versions: 8

Compression:

Stored size: 394 Bytes

Contents

module Ecom
  module Core
    class Crew < ApplicationRecord
      PERMANENT = 'Permanent'.freeze
      TEMPORARY = 'Temporary'.freeze

      belongs_to :crew_type

      validates :name, :qualification, presence: true
      validates :wage, presence: true, if: ->(o) { o.employment == PERMANENT }
      validates :wage, absence: true, if: ->(o) { o.employment == TEMPORARY }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ecom_core-1.0.7 app/models/ecom/core/crew.rb
ecom_core-1.0.6 app/models/ecom/core/crew.rb
ecom_core-1.0.5 app/models/ecom/core/crew.rb
ecom_core-1.0.4 app/models/ecom/core/crew.rb
ecom_core-1.0.3 app/models/ecom/core/crew.rb
ecom_core-1.0.2 app/models/ecom/core/crew.rb
ecom_core-1.0.1 app/models/ecom/core/crew.rb
ecom_core-1.0.0 app/models/ecom/core/crew.rb