Apply Rails/Validation rubocop rule

This commit is contained in:
Javi Martín
2019-06-23 00:46:28 +02:00
parent 27c73c22ea
commit 0788925c1b
5 changed files with 8 additions and 14 deletions

View File

@@ -1,8 +1,7 @@
class Budget
class ContentBlock < ApplicationRecord
validates :locale, presence: true, inclusion: { in: I18n.available_locales.map(&:to_s) }
validates :heading, presence: true
validates_uniqueness_of :heading, scope: :locale
validates :heading, presence: true, uniqueness: { scope: :locale }
belongs_to :heading
end