From 045f722aaa118ec313cb5844685ee99b50d4792a Mon Sep 17 00:00:00 2001
From: Alexander Olofsson <alexander.olofsson@liu.se>
Date: Mon, 13 Mar 2023 11:18:18 +0100
Subject: [PATCH] Fix settings DSL migration

---
 db/migrate/20230313105520_convert_settings_to_dsl.rb | 3 ++-
 lib/foreman_notification_send/version.rb             | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/db/migrate/20230313105520_convert_settings_to_dsl.rb b/db/migrate/20230313105520_convert_settings_to_dsl.rb
index a66d9a1..08b6948 100644
--- a/db/migrate/20230313105520_convert_settings_to_dsl.rb
+++ b/db/migrate/20230313105520_convert_settings_to_dsl.rb
@@ -2,6 +2,7 @@
 
 class ConvertSettingsToDsl < ActiveRecord::Migration[6.0]
   def up
-    Settings.where(category: 'Setting::NotificationSend').update_all(category: 'Setting')
+    Setting.where(category: 'Setting::NotificationSend').update_all(category: 'Setting') \
+      if column_exists?(:settings, :category)
   end
 end
diff --git a/lib/foreman_notification_send/version.rb b/lib/foreman_notification_send/version.rb
index 4a882d7..95eb301 100644
--- a/lib/foreman_notification_send/version.rb
+++ b/lib/foreman_notification_send/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module ForemanNotificationSend
-  VERSION = '0.4.0'
+  VERSION = '0.4.1'
 end
-- 
GitLab