From 9fae5e64350944cd690be47747b0b17ed9a509cc Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 6 Jan 2025 11:47:08 +0100 Subject: [PATCH] bump store_attribute --- Gemfile | 2 +- Gemfile.lock | 4 +-- config/initializers/store_attribute.rb | 34 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 config/initializers/store_attribute.rb diff --git a/Gemfile b/Gemfile index 983b55ad6c12..ebb29e75540d 100644 --- a/Gemfile +++ b/Gemfile @@ -218,7 +218,7 @@ gem "dry-monads" gem "dry-validation" # ActiveRecord extension which adds typecasting to store accessors -gem "store_attribute", "~> 1.0" +gem "store_attribute", "~> 2.0" # Appsignal integration gem "appsignal", "~> 3.10.0", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 1940a6df2b3f..3d93f059200a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1107,7 +1107,7 @@ GEM sprockets (>= 3.0.0) ssrf_filter (1.0.8) stackprof (0.2.26) - store_attribute (1.3.1) + store_attribute (2.0.0) activerecord (>= 6.1) stringex (2.8.6) stringio (3.1.2) @@ -1392,7 +1392,7 @@ DEPENDENCIES sprockets (~> 3.7.2) sprockets-rails (~> 3.5.1) stackprof - store_attribute (~> 1.0) + store_attribute (~> 2.0) stringex (~> 2.8.5) structured_warnings (~> 0.4.0) svg-graph (~> 2.2.0) diff --git a/config/initializers/store_attribute.rb b/config/initializers/store_attribute.rb new file mode 100644 index 000000000000..37d5e4e99e3d --- /dev/null +++ b/config/initializers/store_attribute.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2025 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +# From v1.0 to v2.0 of store_attribute, the value for store_attribute_unset_values_fallback_to_default changed from +# false to true. This initializer sets it back to false to keep the behavior consistent with the previous version. + +StoreAttribute.store_attribute_unset_values_fallback_to_default = false