<commit_before>#------------------------------------------------------------------------------
#
# RehabilitationYearCalculator
#
# Returns the year that an asset should be rehabilitated based on the asset
# and the asset's policy
#
#------------------------------------------------------------------------------
class RehabilitationYearCalculator < Calculator

  # Main entry point
  def calculate(asset)

    Rails.logger.debug "RehabilitationYearCalculator.calculate(asset)"
    # The policy rehabilitation year identifies the year of the assets service
    # that a rehabiliation should be performed. If not set, no rehabiliation
    # will be scheduled otherwise find the fiscal year that is x years after the
    # fiscal year the asset was placed in service
    years_into_service = asset.policy.rehabilitation_year
    if years_into_service.to_i > 0
      # return the in service fiscal year plus the policy rehab year
      fiscal_year_year_on_date(asset.in_service_date) + years_into_service
    else
      nil
    end
  end

  protected

end<commit_msg>fix call to asset policy rehab year<commit_after>#------------------------------------------------------------------------------
#
# RehabilitationYearCalculator
#
# Returns the year that an asset should be rehabilitated based on the asset
# and the asset's policy
#
#------------------------------------------------------------------------------
class RehabilitationYearCalculator < Calculator

  # Main entry point
  def calculate(asset)

    Rails.logger.debug "RehabilitationYearCalculator.calculate(asset)"
    # The policy rehabilitation year identifies the year of the assets service
    # that a rehabiliation should be performed. If not set, no rehabiliation
    # will be scheduled otherwise find the fiscal year that is x years after the
    # fiscal year the asset was placed in service
    years_into_service = asset.policy_rule.rehabilitation_year
    if years_into_service.to_i > 0
      # return the in service fiscal year plus the policy rehab year
      fiscal_year_year_on_date(asset.in_service_date) + years_into_service
    else
      nil
    end
  end

  protected

end
{'fraction_non_alphanumeric': 0.18097447795823665, 'fraction_numerical': 0.0009280742459396752, 'mean_word_length': 2.111111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2395738', 'n_tokens_mistral': 530, 'n_tokens_neox': 497, 'n_words': 199}