module EmbeddedLocalization::ActiveRecord::ClassMethods
Public Instance Methods
fallbacks?()
click to toggle source
determine if we are using fallbacks
# File lib/embedded_localization/active_record/class_methods.rb, line 20 def fallbacks? i18n_fallbacks = I18n.backend.class.included_modules.map(&:to_s).include?('I18n::Backend::Fallbacks') # will be true if config.i18n.fallbacks => true in config i18n_fallbacks || translation_options[:fallbacks] == true end
translated?(name)
click to toggle source
Checks whether field with given name is translated field. Param String or Symbol Returns true or false
# File lib/embedded_localization/active_record/class_methods.rb, line 15 def translated?(name) translated_attribute_names.include?(name.to_sym) end
translated_attributes()
click to toggle source
Returns Array of Symbols for all attributes of this class,
which have translations through acts_as_i18n.
returns an Array of Symbols
# File lib/embedded_localization/active_record/class_methods.rb, line 8 def translated_attributes translated_attribute_names end