Sha256: 33948a524a58121879aeeabfc9856410a3f1c9a9bbdf6f159069697202d0d9c3
Contents?: true
Size: 751 Bytes
Versions: 4
Compression:
Stored size: 751 Bytes
Contents
module Dicer module ActiveRecord extend ActiveSupport::Concern include Dicer::Contextable included do def self.new_with_dicer(*args, &block) if Dicer.config.auto_supply && Dicer::Context.current.present? new_without_dicer(*args, &block).in_context else new_without_dicer(*args, &block) end end def self.instantiate_with_dicer(*args) if Dicer.config.auto_supply && Dicer::Context.current.present? instantiate_without_dicer(*args).in_context else instantiate_without_dicer(*args) end end class << self alias_method_chain :new, :dicer alias_method_chain :instantiate, :dicer end end end end
Version data entries
4 entries across 4 versions & 1 rubygems