Skip to content

Commit

Permalink
Revert "Less is more"
Browse files Browse the repository at this point in the history
This reverts commit 655037d.
  • Loading branch information
mostlyobvious committed Jan 30, 2023
1 parent db1b197 commit fcaa701
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class Event < ::ActiveRecord::Base
self.primary_key = :id
self.table_name = "event_store_events"

attribute :data, PassThrough.new
attribute :metadata, PassThrough.new
attribute :data, :pass_through
attribute :metadata, :pass_through
end
private_constant :Event

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

module RubyEventStore
module ActiveRecord
class PassThrough < ::ActiveRecord::Type::Value
class PassThrough < ::ActiveModel::Type::Value
include ::ActiveModel::Type::Helpers::Mutable

def serialize(value)
value
end

def deserialize(value)
value
end

def type
:pass_through
end
end
end
end

::ActiveRecord::Type.register(:pass_through, ::RubyEventStore::ActiveRecord::PassThrough)

0 comments on commit fcaa701

Please sign in to comment.