sqm-dashboards/app/models/housing.rb
rebuilt 446b3b1096 WIP: Update the parent table to hold a reference to a language
Update the data uploader script to read the language from the csv and update the language information for any parent items that already exist (or create database entries if none already exist)
2025-04-25 16:17:01 -07:00

19 lines
323 B
Ruby

class Housing < ApplicationRecord
has_many :parents, dependent: :nullify
def self.to_designation(housing)
return "Unknown" if housing.blank?
housing = housing
case housing
in /^1$/i
"Own"
in /^2$/i
"Rent"
in /^99$|^100$/i
"Unknown"
else
"Unknown"
end
end
end