Fixes #4018 - Upgraded to 5.1.0: pending time doesn’t show a date.
This commit is contained in:
parent
cb90521e13
commit
2e02221535
2 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
||||||
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
||||||
|
|
||||||
|
class Issue4018RemoveOldTranslations < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
# return if it's a new setup
|
||||||
|
return if !Setting.exists?(name: 'system_init_done')
|
||||||
|
|
||||||
|
Translation.where(source: 'FORMAT_DATE', is_synchronized_from_codebase: false).find_each(&:destroy)
|
||||||
|
end
|
||||||
|
end
|
14
spec/db/migrate/issue_4018_remove_old_translations_spec.rb
Normal file
14
spec/db/migrate/issue_4018_remove_old_translations_spec.rb
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Issue4018RemoveOldTranslations, type: :db_migration do
|
||||||
|
before do
|
||||||
|
create(:translation, source: 'FORMAT_DATE', target_initial: 'Datum', target: 'Datum', is_synchronized_from_codebase: false)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'does remove old translations for source "FORMAT_DATE"' do
|
||||||
|
migrate
|
||||||
|
expect(Translation.where(locale: 'de-de', source: 'FORMAT_DATE').count).to eq(1)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue