mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Add nice formatting for subtypes on account list (#2138)
* Add nice formatting for subtypes on account list * Fix rubocop linting errors * Implement better mapping * Fix rubocop linting * Add short and long versions of subtypes * Simplify subtype reference Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com> Signed-off-by: Alex Hatzenbuhler <hatz@hey.com> * Simplify reference logic, add a small test * Fix test * Fix tests --------- Signed-off-by: Alex Hatzenbuhler <hatz@hey.com> Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>
This commit is contained in:
parent
db34f6d7a2
commit
47aeaf8cea
12 changed files with 83 additions and 30 deletions
|
@ -1,14 +1,14 @@
|
|||
class Property < ApplicationRecord
|
||||
include Accountable
|
||||
|
||||
SUBTYPES = [
|
||||
[ "Single Family Home", "single_family_home" ],
|
||||
[ "Multi-Family Home", "multi_family_home" ],
|
||||
[ "Condominium", "condominium" ],
|
||||
[ "Townhouse", "townhouse" ],
|
||||
[ "Investment Property", "investment_property" ],
|
||||
[ "Second Home", "second_home" ]
|
||||
]
|
||||
SUBTYPES = {
|
||||
"single_family_home" => { short: "Single Family Home", long: "Single Family Home" },
|
||||
"multi_family_home" => { short: "Multi-Family Home", long: "Multi-Family Home" },
|
||||
"condominium" => { short: "Condo", long: "Condominium" },
|
||||
"townhouse" => { short: "Townhouse", long: "Townhouse" },
|
||||
"investment_property" => { short: "Investment Property", long: "Investment Property" },
|
||||
"second_home" => { short: "Second Home", long: "Second Home" }
|
||||
}.freeze
|
||||
|
||||
has_one :address, as: :addressable, dependent: :destroy
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue