Change rule translation interface to display english name and populate empty translations (#35170)
This commit is contained in:
parent
72f2f35bfb
commit
0a7418e6d8
4 changed files with 9 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ class Rule < ApplicationRecord
|
|||
self.discard_column = :deleted_at
|
||||
|
||||
has_many :translations, inverse_of: :rule, class_name: 'RuleTranslation', dependent: :destroy
|
||||
accepts_nested_attributes_for :translations, reject_if: :all_blank, allow_destroy: true
|
||||
accepts_nested_attributes_for :translations, reject_if: ->(attributes) { attributes['text'].blank? }, allow_destroy: true
|
||||
|
||||
validates :text, presence: true, length: { maximum: TEXT_SIZE_LIMIT }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue