Skip to content

Commit

Permalink
Revert "Extract to variable"
Browse files Browse the repository at this point in the history
This reverts commit 8d159f5.
  • Loading branch information
mostlyobvious committed Jan 30, 2023
1 parent b599d6a commit 4d1508f
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ class Event < ::ActiveRecord::Base
self.primary_key = :id
self.table_name = "event_store_events"

skip_json_serialization = ->(type) { %i[json jsonb].include?(type.type) ? ActiveModel::Type::Value.new : type }

attribute :data, skip_json_serialization
attribute :metadata, skip_json_serialization
attribute :data, ->(type) { %i[json jsonb].include?(type.type) ? ActiveModel::Type::Value.new : type }
attribute :metadata, ->(type) { %i[json jsonb].include?(type.type) ? ActiveModel::Type::Value.new : type }
end
private_constant :Event

Expand Down

0 comments on commit 4d1508f

Please sign in to comment.