Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serialize type deprecation warning on Rails 7.1+ #113

Merged
merged 5 commits into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ActiveRecord.version >= Gem::Version.new("7.1.0.beta1")
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