Sha256: bf7d14c11ea948d9e6aaff3eecc0e19444d7ad55273de9e3b255603f9d4a20bd

Contents?: true

Size: 461 Bytes

Versions: 1

Compression:

Stored size: 461 Bytes

Contents

require "action_callback/version"
require "action_callback/define_callback"
require "action_callback/callback"

module ActionCallback
  include Callback
  extend self

  def ActionCallback.extended(mod)
    initialize_callback_chain(mod)

    [:before, :after].each do |callback|
      define_callback(callback)
      alias_method :"#{callback}_filter", :"#{callback}_action"
    end
  end
end

if defined?(Rails)
  ActiveRecord::Base.extend(ActionCallback)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
action_callback-0.2.0 lib/action_callback.rb