Sha256: 9bb2121aaf68ee1e25cd069885025bcce977827e6dec333f7b8a39283c22dd69
Contents?: true
Size: 503 Bytes
Versions: 5
Compression:
Stored size: 503 Bytes
Contents
require 'chillout/creations_container' module Chillout module ActiveRecordCreationListener def inherited(subclass) super listen(subclass) end private def listen(monitored_class) class_name = monitored_class.name monitored_class.after_commit :on => :create do Rails.logger.debug "[Chillout] Model created: #{class_name}" Chillout.creations ||= CreationsContainer.new Chillout.creations.increment!(class_name) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems