Module: Translatable::ActiveRecord::ClassMethods

Defined in:
lib/translatable/active_record/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#translated?(name) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/translatable/active_record/class_methods.rb', line 8

def translated?(name)
  included = translated_attribute_names.detect { |attr| attr.is_a?(Hash) ? attr.keys.include?(name.to_sym) : attr == name.to_sym }
  !included.nil?
end

#translation_classObject



4
5
6
# File 'lib/translatable/active_record/class_methods.rb', line 4

def translation_class
  Translatable.translation_class
end