Pass a keyword argument to the serialize method

We were getting the following warning after upgrading to Rails 7.1:

```
Rendered shared/_social_media_meta_tags.html.erb
DEPRECATION WARNING: Passing the class as positional argument is
deprecated and will be removed in Rails 7.2.
Please pass the class as a keyword argument:
  serialize :metadata, type: Object
```
This commit is contained in:
Javi Martín
2024-04-14 21:50:23 +02:00
parent 65e4a64084
commit 931ccc04fb

View File

@@ -3,7 +3,7 @@ class Legislation::Annotation < ApplicationRecord
acts_as_paranoid column: :hidden_at acts_as_paranoid column: :hidden_at
include ActsAsParanoidAliases include ActsAsParanoidAliases
serialize :ranges, Array serialize :ranges, type: Array
belongs_to :draft_version, foreign_key: "legislation_draft_version_id", inverse_of: :annotations belongs_to :draft_version, foreign_key: "legislation_draft_version_id", inverse_of: :annotations
belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :legislation_annotations belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :legislation_annotations