Browse Source

Prevent accidental serialization of `Account` and `User` records (#30079)

dariusk-working/4_3_0
Claire 2 years ago committed by GitHub
parent
commit
95e9de5777
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      app/models/application_record.rb

6
app/models/application_record.rb

@ -22,4 +22,10 @@ class ApplicationRecord < ActiveRecord::Base
value
end
end
# Prevent implicit serialization in ActiveModel::Serializer or other code paths.
# This is a hardening step to avoid accidental leaking of attributes.
def as_json
raise NotImplementedError
end
end

Loading…
Cancel
Save