lib/rom/repository/changeset/update.rb in rom-repository-0.3.1 vs lib/rom/repository/changeset/update.rb in rom-repository-1.0.0.beta1
- old
+ new
@@ -69,14 +69,24 @@
#
# @api public
def diff
@diff ||=
begin
- new_tuple = data.to_a
+ new_tuple = __data__.to_a
ori_tuple = original.to_a
Hash[new_tuple - (new_tuple & ori_tuple)]
end
+ end
+
+ # @api private
+ def command
+ command_compiler.(command_type, relation, mapper: false).curry(to_h) if diff?
+ end
+
+ # @api private
+ def default_command_type
+ :update
end
end
end
end