Module: TimeOffPoliciesHelper
- Defined in:
- app/helpers/time_off_policies_helper.rb
Overview
View helper: time off policies.
Instance Method Summary collapse
Instance Method Details
#policy_details(policy) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'app/helpers/time_off_policies_helper.rb', line 4 def policy_details(policy) details = [] details << "on #{Date::DAYNAMES[policy.weekly_accrual_day]}" if policy.weekly_accrual_day.present? details << "on day #{policy.monthly_accrual_day}" if policy.monthly_accrual_day.present? details << "at #{policy.annual_accrual_timing.humanize}" if policy.annual_accrual_timing.present? details << "On Date: #{policy.custom_accrual_date}" if policy.custom_accrual_date.present? details.empty? ? 'N/A' : details.join(' | ') end |