Sha256: 95e17adcfdc029a8c8e27aa853cff0a2cac28520a9519b4c8e3d8bd0d6f33f6a
Contents?: true
Size: 931 Bytes
Versions: 2
Compression:
Stored size: 931 Bytes
Contents
# frozen_string_literal: true module ActiveRecord::Bitemporal module Callbacks extend ActiveSupport::Concern included do define_model_callbacks :bitemporal_create define_model_callbacks :bitemporal_update define_model_callbacks :bitemporal_destroy end def destroy perform_bitemporal_callbacks? ? run_callbacks(:bitemporal_destroy) { super } : super end def save_without_bitemporal_callbacks!(...) with_bitemporal_option(ignore_bitemporal_callbacks: true) { save!(...) } end private def _create_record perform_bitemporal_callbacks? ? run_callbacks(:bitemporal_create) { super } : super end def _update_record(*) perform_bitemporal_callbacks? ? run_callbacks(:bitemporal_update) { super } : super end def perform_bitemporal_callbacks? bitemporal_option[:ignore_bitemporal_callbacks] != true end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activerecord-bitemporal-4.1.0 | lib/activerecord-bitemporal/callbacks.rb |
activerecord-bitemporal-4.0.0 | lib/activerecord-bitemporal/callbacks.rb |