Refactor globalize models code using a concern

I've chosen the name "Globalizable" because "Translatable" already
existed.
This commit is contained in:
Javi Martín
2018-10-11 02:29:08 +02:00
committed by decabeza
parent 1ab3b7f42d
commit a38eac02df
13 changed files with 20 additions and 24 deletions

View File

@@ -3,8 +3,7 @@ class AdminNotification < ActiveRecord::Base
translates :title, touch: true
translates :body, touch: true
globalize_accessors
accepts_nested_attributes_for :translations, allow_destroy: true
include Globalizable
translation_class.instance_eval do
validates :title, presence: true