Module: Mongoid::Translation

Extended by:
ActiveSupport::Concern
Defined in:
lib/mongoid_translate.rb,
lib/mongoid/translation.rb,
lib/mongoid/translation/slug.rb

Overview

Translate

Defined Under Namespace

Modules: Slug

Instance Method Summary collapse

Instance Method Details

#main_translation?Boolean

Check if current translation is main_translation.

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/mongoid/translation.rb', line 26

def main_translation?
  parent = self.class.to_s.sub(/^.*::/, '').underscore
  self.send(parent).main_language == self.language
end