diff --git a/lib/rails-settings/setting_object.rb b/lib/rails-settings/setting_object.rb index 5f60f30..865a2ea 100644 --- a/lib/rails-settings/setting_object.rb +++ b/lib/rails-settings/setting_object.rb @@ -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.