adds budgets_helper
This commit is contained in:
11
app/helpers/budgets_helper.rb
Normal file
11
app/helpers/budgets_helper.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module BudgetsHelper
|
||||
|
||||
def budget_phases_select_options
|
||||
Budget::VALID_PHASES.map { |ph| [ t("budget.phase.#{ph}"), ph ] }
|
||||
end
|
||||
|
||||
def budget_currency_symbol_select_options
|
||||
Budget::CURRENCY_SYMBOLS.map { |cs| [ cs, cs ] }
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,7 +1,9 @@
|
||||
class Budget < ActiveRecord::Base
|
||||
|
||||
VALID_PHASES = %W{on_hold accepting selecting balloting finished}
|
||||
CURRENCY_SYMBOLS = %W{€ $ £ ¥}
|
||||
|
||||
validates :name, presence: true
|
||||
validates :phase, inclusion: { in: VALID_PHASES }
|
||||
|
||||
has_many :investments, dependent: :destroy
|
||||
|
||||
Reference in New Issue
Block a user