Sha256: f1854750437bc24766522e05696b3f55c8264dd00c735fd1730013dffbda32d8
Contents?: true
Size: 1.08 KB
Versions: 28
Compression:
Stored size: 1.08 KB
Contents
class AwesomeTranslations::CleanUpsController < AwesomeTranslations::ApplicationController def new end def create ids = [] params[:c].each do |translation_value_id, check_value| ids << translation_value_id.to_i if check_value == "1" end translation_values = AwesomeTranslations::CacheDatabaseGenerator::TranslationValue .where(id: ids) translation_values.each do |translation_value| AwesomeTranslations::TranslationMigrator.new(translation_value: translation_value).execute translation_value.destroy! end redirect_to [:new, :clean_up] end private helper_method :translations_to_clean_up def translations_to_clean_up @translations_to_migrate ||= AwesomeTranslations::CacheDatabaseGenerator::TranslationValue .joins(:translation_key) .includes(:translation_key) .joins("LEFT JOIN handler_translations ON handler_translations.translation_key_id = translation_keys.id") .where("handler_translations.id IS NULL") .where("translation_values.file_path LIKE '%/config/locales/awesome_translations/%'") end end
Version data entries
28 entries across 28 versions & 1 rubygems