Sha256: 9d08e33f6235ef8d786b5cb04660ac79af1d17fa344720822adecec15e4d7cb0
Contents?: true
Size: 412 Bytes
Versions: 9
Compression:
Stored size: 412 Bytes
Contents
module DbMemoize # The Helpers module contains some helper methods, mostly to not pollute # the namespace of memoized objects and classes. module Helpers extend self def find_ids(records_or_ids) records_or_ids = Array(records_or_ids) return [] if records_or_ids.empty? records_or_ids.first.is_a?(ActiveRecord::Base) ? records_or_ids.map(&:id) : records_or_ids end end end
Version data entries
9 entries across 9 versions & 1 rubygems