Sha256: 2bafdb5d71059d25e56da4210d1967fbfb40bc46e31a418d6d97241ac2c7b509
Contents?: true
Size: 561 Bytes
Versions: 15
Compression:
Stored size: 561 Bytes
Contents
# frozen_string_literal: true module Thredded class BaseMailer < ActionMailer::Base helper ::Thredded::UrlsHelper protected # Find a record by ID, or return the passed record. # @param [Class<ActiveRecord::Base>] klass # @param [Fixnum, String, klass] id_or_record # @return [klass] def find_record(klass, id_or_record) # Check by name because in development the Class might have been reloaded after id was initialized id_or_record.class.name == klass.name ? id_or_record : klass.find(id_or_record) end end end
Version data entries
15 entries across 15 versions & 1 rubygems