Module: MagicAddresses::Translator::ClassMethods

Defined in:
lib/app/models/magic_addresses/translator.rb

Overview

C L A S S - M E T H O D S # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Instance Method Summary collapse

Instance Method Details

#mgca_translate(field = :name) ⇒ Object



12
13
14
15
16
17
# File 'lib/app/models/magic_addresses/translator.rb', line 12

def mgca_translate( field = :name )
  send :include, InstanceMethods
  
  translates field, fallbacks_for_empty_translations: true
  accepts_nested_attributes_for :translations, reject_if: proc { |attributes| attributes[field.to_s].blank? }
end