Skip to content

Commit

Permalink
Avoid "comparison of Gem::Version..." error in Ruby < 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lorint committed Feb 23, 2023
1 parent d2af670 commit 093cc00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/coders/yaml_column.rb
Expand Up @@ -11,7 +11,7 @@ def initialize(permitted_classes: [], unsafe_load: nil)
@unsafe_load = unsafe_load
end

if Gem::Version.new(Psych::VERSION) >= "5.1"
if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("5.1")
def dump(object)
if @unsafe_load.nil? ? ActiveRecord.use_yaml_unsafe_load : @unsafe_load
::YAML.dump(object)
Expand Down

0 comments on commit 093cc00

Please sign in to comment.