193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
# File 'lib/active_record/bitwise.rb', line 193
def update_all(updates)
if updates.is_a?(Hash) && T.unsafe(self).klass.respond_to?(:bitwise_definitions)
processed_updates = updates.dup
T.unsafe(self).klass.bitwise_definitions.each_key do |column_name|
[column_name, column_name.to_s].each do |key|
next unless processed_updates.key?(key)
val = processed_updates[key]
next if val.is_a?(Integer)
typecaster = T.unsafe(self).klass.attribute_types[column_name.to_s]
processed_updates[key] = typecaster.serialize(typecaster.cast(val)) if typecaster.is_a?(ActiveRecord::Bitwise::Type)
end
end
super(processed_updates)
else
super
end
end
|