Simplify code checking whether to enable a locale

This commit is contained in:
Javi Martín
2018-10-18 00:31:51 +02:00
parent f5bb3c64a1
commit 93a7cb6c0f
2 changed files with 9 additions and 4 deletions

View File

@@ -4,6 +4,10 @@ module Globalizable
included do
globalize_accessors
accepts_nested_attributes_for :translations, allow_destroy: true
def locales_not_marked_for_destruction
translations.reject(&:_destroy).map(&:locale)
end
end
class_methods do