Sha256: f2a35d1e8e3439d5c73ab8d50da3f52e92f7e4e88c14a37071ecb8168107b567
Contents?: true
Size: 826 Bytes
Versions: 12
Compression:
Stored size: 826 Bytes
Contents
module ActiveRecord::Turntable module ActiveRecordExt module Relation # @note Override to add sharding scope on updating def _update_record(values, id, id_was, turntable_scope = nil) # :nodoc: substitutes, binds = substitute_values values scope = @klass.unscoped if @klass.finder_needs_type_condition? scope.unscope!(where: @klass.inheritance_column) end relation = scope.where(@klass.primary_key => (id_was || id)) relation = relation.merge(turntable_scope) if turntable_scope bvs = binds + relation.bound_attributes um = relation. arel. compile_update(substitutes, @klass.primary_key) @klass.connection.update( um, "SQL", bvs ) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems