From ded5c52ea97d1f2f4d89935d7a87d6fbaed05711 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Mon, 11 Nov 2024 15:17:03 +0100 Subject: [PATCH] Rails 8 compatibility When using `super` there are circumstances (that I haven't understood fully) where you end up with the following error: ``` NoMethodError: super: no superclass method `name=' for an instance of Gutentag::Tag ``` Using `write_attribute` instead seems to help. --- app/models/gutentag/tag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/gutentag/tag.rb b/app/models/gutentag/tag.rb index a74dc45..c90eb3b 100644 --- a/app/models/gutentag/tag.rb +++ b/app/models/gutentag/tag.rb @@ -33,7 +33,7 @@ def self.names_for_scope(scope) end def name=(value) - super(Gutentag.normaliser.call(value)) + write_attribute(:name, Gutentag.normaliser.call(value)) end end