commit
c657a3efc5
@ -0,0 +1,31 @@ |
||||
class FixInvalidJournals < ActiveRecord::Migration[7.0] |
||||
def up |
||||
get_broken_journals.each do |journable_type, relation| |
||||
next unless relation.any? |
||||
|
||||
# rubocop:disable Rails/Output |
||||
puts "Cleaning up broken journals on #{journable_type}" |
||||
# rubocop:enable Rails/Output |
||||
relation.destroy_all |
||||
end |
||||
end |
||||
|
||||
def down |
||||
# nothing to do |
||||
end |
||||
|
||||
def get_broken_journals |
||||
Journal |
||||
.pluck('DISTINCT(journable_type)') |
||||
.compact |
||||
.to_h do |journable_type| |
||||
journal_class = journable_type.constantize.journal_class |
||||
|
||||
relation = Journal |
||||
.where(journable_type:) |
||||
.where.not(data_type: journal_class.to_s) |
||||
|
||||
[journable_type, relation] |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,29 @@ |
||||
--- |
||||
title: OpenProject 12.2.4 |
||||
sidebar_navigation: |
||||
title: 12.2.4 |
||||
release_version: 12.2.4 |
||||
release_date: 2022-09-15 |
||||
--- |
||||
|
||||
# OpenProject 12.2.4 |
||||
|
||||
Release date: 2022-09-15 |
||||
|
||||
We released [OpenProject 12.2.4](https://community.openproject.com/versions/1599). |
||||
The release contains several bug fixes and we recommend updating to the newest version. |
||||
|
||||
<!--more--> |
||||
#### Bug fixes and changes |
||||
|
||||
- Fixed: Remaining hours sum not well formed \[[#43833](https://community.openproject.com/wp/43833)\] |
||||
- Fixed: Destroy journals with invalid data_type associations \[[#44132](https://community.openproject.com/wp/44132)\] |
||||
- Fixed: Internal error / Illegal instruction error \[[#44155](https://community.openproject.com/wp/44155)\] |
||||
- Fixed: Dragging images to CKEditor on Grid custom texts not working with direct upload \[[#44156](https://community.openproject.com/wp/44156)\] |
||||
|
||||
#### Contributions |
||||
A big thanks to community members for reporting bugs and helping us identifying and providing fixes. |
||||
|
||||
Special thanks for reporting and finding bugs go to |
||||
|
||||
Nico Aymet |
Loading…
Reference in new issue