Skip to content

Commit

Permalink
Fix serialize type deprecation warning on Rails 7.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
mikker committed Sep 20, 2023
1 parent cdd6cac commit e93e8bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rails-settings/setting_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ class SettingObject < ActiveRecord::Base
end
end

serialize :value, Hash
if Rails.version >= "7.1"
serialize :value, type: Hash
else
serialize :value, Hash
end

if RailsSettings.can_protect_attributes?
# attr_protected can not be used here because it touches the database which is not connected yet.
Expand Down

0 comments on commit e93e8bf

Please sign in to comment.