Files
grecia/app/models/budget/reclassified_vote.rb
taitus ecde8c6439 Add lambda to the validations that use model constants
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.
2022-03-22 15:52:36 +01:00

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