Module: Translatable::ActiveRecord::InstanceMethods

Defined in:
lib/translatable/active_record.rb

Instance Method Summary collapse

Instance Method Details

#current_translationObject



240
241
242
243
# File 'lib/translatable/active_record.rb', line 240

def current_translation
  update_current_translation unless @translatable_locale
  @current_translation
end

#other_translationsObject



249
250
251
# File 'lib/translatable/active_record.rb', line 249

def other_translations
  translations - [current_translation]
end

#update_current_translationObject



245
246
247
# File 'lib/translatable/active_record.rb', line 245

def update_current_translation
  translatable_set_current(@translatable_locale = ::I18n.locale.to_s)
end