diff --git a/app/models/budget.rb b/app/models/budget.rb index 133956b07..c4fe62eeb 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -22,8 +22,6 @@ class Budget < ApplicationRecord CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze - before_validation :assign_model_to_translations - validates_translation :name, presence: true validates :phase, inclusion: { in: Budget::Phase::PHASE_KINDS } validates :currency_symbol, presence: true diff --git a/app/models/budget/group.rb b/app/models/budget/group.rb index 43d28a0ae..bfa5814c5 100644 --- a/app/models/budget/group.rb +++ b/app/models/budget/group.rb @@ -22,8 +22,6 @@ class Budget has_many :headings, dependent: :destroy - before_validation :assign_model_to_translations - validates_translation :name, presence: true validates :budget_id, presence: true validates :slug, presence: true, format: /\A[a-z0-9\-_]+\z/ diff --git a/app/models/budget/heading.rb b/app/models/budget/heading.rb index 7b33c4e54..108e07fa8 100644 --- a/app/models/budget/heading.rb +++ b/app/models/budget/heading.rb @@ -26,8 +26,6 @@ class Budget has_many :investments has_many :content_blocks - before_validation :assign_model_to_translations - validates_translation :name, presence: true validates :group_id, presence: true validates :price, presence: true diff --git a/app/models/concerns/globalizable.rb b/app/models/concerns/globalizable.rb index a225c9236..15db83919 100644 --- a/app/models/concerns/globalizable.rb +++ b/app/models/concerns/globalizable.rb @@ -9,10 +9,6 @@ module Globalizable translations.reject(&:_destroy).map(&:locale) end - def assign_model_to_translations - translations.each { |translation| translation.globalized_model = self } - end - def description self.read_attribute(:description).try :html_safe end diff --git a/app/models/progress_bar.rb b/app/models/progress_bar.rb index c0bacc7ba..e9994f011 100644 --- a/app/models/progress_bar.rb +++ b/app/models/progress_bar.rb @@ -18,7 +18,6 @@ class ProgressBar < ApplicationRecord } validates :percentage, presence: true, inclusion: RANGE, numericality: { only_integer: true } - before_validation :assign_model_to_translations validates_translation :title, presence: true, unless: :primary? end