Validate the format of FinancialTransactionType.name_short

This commit is contained in:
Patrick Gansterer 2020-02-24 14:46:39 +01:00
parent 54f9ffcc52
commit 226d2dda74

View file

@ -5,6 +5,7 @@ class FinancialTransactionType < ApplicationRecord
validates :name, presence: true validates :name, presence: true
validates_uniqueness_of :name validates_uniqueness_of :name
validates_uniqueness_of :name_short, allow_blank: true, allow_nil: true validates_uniqueness_of :name_short, allow_blank: true, allow_nil: true
validates_format_of :name_short, :with => /\A[A-Za-z]*\z/
validates :financial_transaction_class, presence: true validates :financial_transaction_class, presence: true
before_destroy :restrict_deleting_last_financial_transaction_type before_destroy :restrict_deleting_last_financial_transaction_type