From 6bc0ef80fbdb60afc06006382d4b5013e033b845 Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Thu, 30 Nov 2023 17:03:45 +0000 Subject: [PATCH] Add Budget Category enumeration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replacing ‘activity’ on budget type with this—they should come from a user’s role rather than the activity. Going with a generic name though so this can change over time. --- app/models/time_budget_category.rb | 11 +++++++++++ config/locales/en.yml | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 app/models/time_budget_category.rb diff --git a/app/models/time_budget_category.rb b/app/models/time_budget_category.rb new file mode 100644 index 0000000..919c076 --- /dev/null +++ b/app/models/time_budget_category.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class TimeBudgetCategory < Enumeration + has_many :time_budgets, foreign_key: :category_id + + OptionName = :enumeration_time_budget_category + + def option_name + OptionName + end +end diff --git a/config/locales/en.yml b/config/locales/en.yml index 0a110b8..6704079 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,3 +1,5 @@ en: field_jobs: Jobs field_job: Job + + enumeration_time_budget_category: Time budget categories