Skip to content

Commit

Permalink
Prevent accidental serialization of Account and User records (mas…
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Apr 29, 2024
1 parent e336466 commit 95e9de5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/application_record.rb
Expand Up @@ -22,4 +22,10 @@ def boolean_with_default(key, default_value)
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

0 comments on commit 95e9de5

Please sign in to comment.