Sha256: 5dac0c15dc4e20f8ec7dbfd19f24a34c748506826a653ea6179f25155c2eef5a

Contents?: true

Size: 384 Bytes

Versions: 12

Compression:

Stored size: 384 Bytes

Contents

module Ecom
  module Core
    class Payroll < ApplicationRecord
      validates :month, :year, presence: true

      has_many :payments, class_name: 'Ecom::Core::Payment'
      belongs_to :project

      scope :by_project, ->(id) { where(project_id: id) }
      scope :by_month, ->(month) { where(month: month) }
      scope :by_year, ->(year) { where(year: year) }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ecom_core-1.2.20 app/models/ecom/core/payroll.rb
ecom_core-1.2.19 app/models/ecom/core/payroll.rb
ecom_core-1.2.18 app/models/ecom/core/payroll.rb
ecom_core-1.2.17 app/models/ecom/core/payroll.rb
ecom_core-1.2.16 app/models/ecom/core/payroll.rb
ecom_core-1.2.15 app/models/ecom/core/payroll.rb
ecom_core-1.2.14 app/models/ecom/core/payroll.rb
ecom_core-1.2.13 app/models/ecom/core/payroll.rb
ecom_core-1.2.12 app/models/ecom/core/payroll.rb
ecom_core-1.2.11 app/models/ecom/core/payroll.rb
ecom_core-1.2.10 app/models/ecom/core/payroll.rb
ecom_core-1.2.9 app/models/ecom/core/payroll.rb