Remove unneded before validation callbacks

After globalize gem update there is no need to keep this monkey patch.

More information here [1]

[1] 3075c89b70
This commit is contained in:
Senén Rodero Rodríguez
2019-03-29 15:49:11 +01:00
committed by voodoorai2000
parent 4068ef29ee
commit da1c5fdb01
5 changed files with 0 additions and 11 deletions

View File

@@ -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

View File

@@ -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/

View File

@@ -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

View File

@@ -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

View File

@@ -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