Fix compatibility with Psych 4
Fix compatibility with Psych 4

Ruby 3.1 uses Psych 4. This is a lift of how Rails [works around this
problem](https://github.com/rails/rails/commit/179d0a1f474ada02e0030ac3bd062fc653765dbe)

zendesk/active_record_shards