Skip to content

Commit

Permalink
Revert "We don't introduce anything new over Value here"
Browse files Browse the repository at this point in the history
This reverts commit c5812c2.
  • Loading branch information
mostlyobvious committed Jan 30, 2023
1 parent ccc697e commit 101540d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative "active_record/generators/migration_generator"
require_relative "active_record/generators/rails_migration_generator"
require_relative "active_record/pass_through"
require_relative "active_record/event"
require_relative "active_record/with_default_models"
require_relative "active_record/with_abstract_base_class"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# frozen_string_literal: true

require "active_record"

module RubyEventStore
module ActiveRecord
class Event < ::ActiveRecord::Base
self.primary_key = :id
self.table_name = "event_store_events"

attribute :data, ActiveModel::Type::Value.new
attribute :metadata, ActiveModel::Type::Value.new
attribute :data, PassThrough.new
attribute :metadata, PassThrough.new
end
private_constant :Event

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require "active_record"

module RubyEventStore
module ActiveRecord
class PassThrough < ::ActiveRecord::Type::Value
def serialize(value)
value
end

def deserialize(value)
value
end
end
end
end

0 comments on commit 101540d

Please sign in to comment.