Class: PayrollHoliday

Inherits:
ApplicationRecord show all
Includes:
PayrollHolidaysProcedures
Defined in:
app/models/payroll_holiday.rb

Class Method Summary collapse

Methods included from PayrollHolidaysProcedures

#create_or_update_procedure

Methods inherited from ApplicationRecord

define_decrypted_attribute, define_decrypted_attributes, #errors_in_bullet_points, primary_connection, special_connection

Class Method Details

.for_year(year) ⇒ Object



10
11
12
# File 'app/models/payroll_holiday.rb', line 10

def self.for_year(year)
  PayrollHoliday.where('YEAR(date) = ?', year)
end

.yearsObject



6
7
8
# File 'app/models/payroll_holiday.rb', line 6

def self.years
  PayrollHoliday.distinct.pluck('YEAR(date)').map(&:to_i)
end