instance method write_multi

Ruby on Rails 6.1.7.10

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

write_multi(hash, options = nil)

Cache Storage API to write multiple values at once.

Parameters

hash req
options opt = nil
Source
# File activesupport/lib/active_support/cache.rb, line 406
      def write_multi(hash, options = nil)
        options = merged_options(options)

        instrument :write_multi, 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 406 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Cache::Store

Type at least 2 characters to search.

↑↓ navigate · open · esc close