Refactor globalize models code using a concern
I've chosen the name "Globalizable" because "Translatable" already existed.
This commit is contained in:
@@ -6,8 +6,7 @@ class Poll::Question < ActiveRecord::Base
|
||||
include ActsAsParanoidAliases
|
||||
|
||||
translates :title, touch: true
|
||||
globalize_accessors
|
||||
accepts_nested_attributes_for :translations, allow_destroy: true
|
||||
include Globalizable
|
||||
|
||||
belongs_to :poll
|
||||
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
|
||||
|
||||
Reference in New Issue
Block a user