You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sqm-dashboards/app/models/income.rb

20 lines
505 B

class Income < ApplicationRecord
scope :by_designation, -> { all.map { |income| [income.designation, income] }.to_h }
scope :by_slug, -> { all.map { |income| [income.slug, income] }.to_h }
include FriendlyId
friendly_id :designation, use: [:slugged]
def label
case designation
when "Economically Disadvantaged - Y"
"Economically Disadvantaged"
when "Economically Disadvantaged - N"
"Not Economically Disadvantaged"
when "Unknown"
"Unknown"
end
end
end