instance method
write_multi
Ruby on Rails 8.0.4
Since v5.2.8.1Signature
write_multi(hash, options = nil)
Cache Storage API to write multiple values at once.
Parameters
-
hashreq -
optionsopt = nil
Source
# File activesupport/lib/active_support/cache.rb, line 552
def write_multi(hash, options = nil)
return hash if hash.empty?
options = merged_options(options)
normalized_hash = hash.transform_keys { |key| normalize_key(key, options) }
instrument_multi :write_multi, normalized_hash, options do |payload|
entries = hash.each_with_object({}) do |(name, value), memo|
memo[normalize_key(name, options)] = Entry.new(value, **options.merge(version: normalize_version(name, options)))
end
write_multi_entries entries, **options
end
end
Defined in activesupport/lib/active_support/cache.rb line 552
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::Store