In this way when we need modify the constants model value in the model/custom folder, adding lambda it will be possible load the new values.
13 lines
326 B
Ruby
13 lines
326 B
Ruby
class Budget
|
|
class ReclassifiedVote < ApplicationRecord
|
|
REASONS = %w[heading_changed unfeasible].freeze
|
|
|
|
belongs_to :user
|
|
belongs_to :investment
|
|
|
|
validates :user, presence: true
|
|
validates :investment, presence: true
|
|
validates :reason, inclusion: { in: ->(*) { REASONS }, allow_nil: false }
|
|
end
|
|
end
|