lib/clowne/adapters/sequel/operation.rb in clowne-1.1.0 vs lib/clowne/adapters/sequel/operation.rb in clowne-1.2.0
- old
+ new
@@ -1,15 +1,14 @@
# frozen_string_literal: true
-require 'clowne/ext/record_key'
+require "clowne/ext/record_key"
module Clowne
module Adapters
class Sequel # :nodoc: all
class Operation < Clowne::Utils::Operation
include Clowne::Ext::RecordKey
-
def initialize(mapper)
super
@records = {}
end
@@ -21,9 +20,11 @@
@records[key(@clone)]
end
def to_record
return @_record if defined?(@_record)
+
+ record_wrapper(@clone)
@_record = @records[key(@clone)].to_model.tap do
run_after_clone
end
end