Class: HrLite::HolidaysController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- HrLite::HolidaysController
- Defined in:
- app/controllers/hr_lite/holidays_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
3 4 5 6 7 |
# File 'app/controllers/hr_lite/holidays_controller.rb', line 3 def index year = params[:year].to_i @year = year.between?(2000, 2100) ? year : Date.current.year @holidays = Holiday.where(date: Date.new(@year, 1, 1)..Date.new(@year, 12, 31)).order(:date) end |