Module: HasManyTranslations::Control::InstanceMethods

Defined in:
lib/has_many_translations/control.rb

Instance Method Summary collapse

Instance Method Details

#force_updateObject



14
15
16
17
18
19
# File 'lib/has_many_translations/control.rb', line 14

def force_update
  with_translation_flag(:force_update) do
    yield if block_given?
    save
  end
end

#force_update!Object



20
21
22
23
24
25
# File 'lib/has_many_translations/control.rb', line 20

def force_update!
  with_translation_flag(:force_update) do
    yield if block_given?
    update_translations!
  end
end

#force_update?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/has_many_translations/control.rb', line 27

def force_update?
  !!@force_update
end

#skip_translationObject



31
32
33
34
35
36
# File 'lib/has_many_translations/control.rb', line 31

def skip_translation
  with_translation_flag(:skip_translation) do
    yield if block_given?
    save
  end
end

#skip_translation!Object



38
39
40
41
42
43
# File 'lib/has_many_translations/control.rb', line 38

def skip_translation!
  with_translation_flag(:skip_translation) do
    yield if block_given?
    save!
  end
end

#skip_translation?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/has_many_translations/control.rb', line 45

def skip_translation?
  !!@skip_translation
end