Sha256: ca196e04a3cbaf2c4c19ad2bb2d3545239fe1bf86cff5f31d7c6609a709a8e35

Contents?: true

Size: 379 Bytes

Versions: 4

Compression:

Stored size: 379 Bytes

Contents

require 'chillout/creations_container'

module Chillout
  module CreationListener
    def inherited(subclass)
      super
      class_name = subclass.name
      subclass.after_commit :on => :create do
        Thread.current[:creations] ||= CreationsContainer.new
        creations = Thread.current[:creations]
        creations.increment!(class_name)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chillout-0.5.2 lib/chillout/creation_listener.rb
chillout-0.5.1 lib/chillout/creation_listener.rb
chillout-0.5.0 lib/chillout/creation_listener.rb
chillout-0.4.1 lib/chillout/creation_listener.rb