Class: AwesomeTranslations::CleanUpsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/awesome_translations/clean_ups_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/awesome_translations/clean_ups_controller.rb', line 4

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

#newObject



2
# File 'app/controllers/awesome_translations/clean_ups_controller.rb', line 2

def new; end