From ad0f617d7cb95528f3ac58f98503bdc2de2b7ef2 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Fri, 19 Jul 2019 03:17:33 +0300 Subject: [PATCH] #1955: Change the logic concerning unused tags and add CHANGELOG entries --- .../20190618202817_add_user_id_to_tag.rb | 21 +++++++++++++------ doc/CHANGELOG.md | 14 +++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/db/migrate/20190618202817_add_user_id_to_tag.rb b/db/migrate/20190618202817_add_user_id_to_tag.rb index 994056f0..9483338c 100644 --- a/db/migrate/20190618202817_add_user_id_to_tag.rb +++ b/db/migrate/20190618202817_add_user_id_to_tag.rb @@ -65,12 +65,21 @@ class AddUserIdToTag < ActiveRecord::Migration[5.2] tag.save! end - # Set all unowned tags to user ID #1, because they're unused. - execute <<-EOQ - UPDATE tags - SET user_id = 1 - WHERE user_id IS NULL - EOQ + # Set all unowned tags to the only user, if there's only one. Otherwise + # remove them since there's no way of knowing who they belong to. + if User.all.count == 1 + uid = User.first.id + execute <<-EOQ + UPDATE tags + SET user_id = #{uid} + WHERE user_id IS NULL + EOQ + else + execute <<-EOQ + DELETE FROM tags + WHERE user_id IS NULL + EOQ + end end def self.down remove_column :tags, :user_id diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 038ba777..e3a0f8b0 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,13 +1,27 @@ ## Version 2.4 +### New features * Removed support for deprecated password-hashing algorithm. This eliminates config.salt. Note the addition of a pre-upgrade step to check for obsolete passwords. +* All tags now belong to a user. Existing tags are migrated to users based on + the taggings and duplicated as necessary. If there's only one user, all unused tags are + assigned to them, otherwise unused tags are removed. +* All REST APIs now also accept user token as password. +* The stats view now uses Charts.js instead of the Flash-based chart library. +* A Docker environment is used unless the .skip-docker file exists. * Rails 4.2 * Thin replaces WEBrick as the included web server * Tracks is tested on Ruby 1.9.3, 2.0.0, 2.1, and 2.2. * The MessageGateway will save the received email as an attachement to the todo * Add a configuration option for serving static assets from Rails +### Removed features +* Ruby versions below 2.4 are no longer supported. + +### Bug fixes +* Multiple fixes to REST APIs. +* Several UI bugs fixed. + ## Version 2.3.0 ### New and changed features