Sha256: 929b61467dbe9fa34936be7dbde1571f66b4a7848a0364c0ca4ec84cdcb7e03b
Contents?: true
Size: 395 Bytes
Versions: 5
Compression:
Stored size: 395 Bytes
Contents
module Ecom module Model 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
5 entries across 5 versions & 1 rubygems