Module: MagicAddresses::Translator::InstanceMethods

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

Overview

I N S T A N C E - M E T H O D S # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

need to be loaded so stupid, otherwise it is accessible for all model (tested with rspec)



32
33
34
# File 'lib/app/models/magic_addresses/translator.rb', line 32

def self.included(base)
  base.send :extend, MoreClassMethods
end

Instance Method Details

#with_translations(*locales) ⇒ Object



26
27
28
29
# File 'lib/app/models/magic_addresses/translator.rb', line 26

def with_translations(*locales)
  locales = translated_locales if locales.empty?
  includes(:translations).with_locales(locales).with_required_attributes
end