Skip to content

Commit

Permalink
Fix serialize type deprecation warning on Rails 7.1+ (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikker committed Sep 22, 2023
1 parent cdd6cac commit 1f5d1da
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 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

0 comments on commit 1f5d1da

Please sign in to comment.