lib/sequel/plugins/bitemporal.rb in sequel_bitemporal-0.10.0 vs lib/sequel/plugins/bitemporal.rb in sequel_bitemporal-0.11.0
- old
+ new
@@ -330,11 +330,11 @@
version_values
else
{ master_id: id }
end
- current_version.keys.each do |key|
+ current_version.columns.each do |key|
next if excluded_columns.include? key
current_attributes[key] = current_version.public_send key
end if current_version?
model.version_class.new current_attributes
end
@@ -590,21 +590,21 @@
success
end
def save_fossil(expired, attributes={})
fossil = model.version_class.new
- expired_attributes = expired.keys.each_with_object({}) do |key, hash|
+ expired_attributes = expired.columns.each_with_object({}) do |key, hash|
hash[key] = expired.public_send key
end
expired_attributes.delete :id
fossil.set_all expired_attributes.merge(attributes)
fossil.save validate: false
fossil.send :_refresh_set_values, fossil.values
end
def save_propagated(version, attributes={})
propagated = model.version_class.new
- version_attributes = version.keys.each_with_object({}) do |key, hash|
+ version_attributes = version.columns.each_with_object({}) do |key, hash|
hash[key] = version.public_send key
end
version_attributes.delete :id
version_attributes[:created_at] = Sequel::Plugins::Bitemporal.point_in_time
propagated.set_all version_attributes.merge(attributes)