Module: Mobility::Backends::Sequel::KeyValue::DestroyKeyValueTranslations

Defined in:
lib/mobility/backends/sequel/key_value.rb

Overview

Clean up all leftover translations of this model, only once.

Instance Method Summary collapse

Instance Method Details

#after_destroyObject


184
185
186
187
188
189
190
# File 'lib/mobility/backends/sequel/key_value.rb', line 184

def after_destroy
  super
  [:string, :text].freeze.each do |type|
    Mobility::Sequel.const_get("#{type.capitalize}Translation").
      where(translatable_id: id, translatable_type: self.class.name).destroy
  end
end