Sha256: 70d594ce34f2ff44fb61672711443582dae1de5fc0397a8c75ae60ef47fb79fe

Contents?: true

Size: 803 Bytes

Versions: 4

Compression:

Stored size: 803 Bytes

Contents

require 'mcfly/migration'
require 'mcfly/has_mcfly'
require 'mcfly/controller'
require 'active_support'

module Mcfly
  # ATTRIBUTION: some of the code in this project has been shamelessly
  # lifted form paper_trail.

  # Sets who is responsible for any changes that occur.  You would
  # normally use this in a migration or on the console, when working
  # with models directly.
  def self.whodunnit=(value)
    mcfly_store[:whodunnit] = value
  end

  def self.whodunnit
    mcfly_store[:whodunnit]
  end

  private

  # Thread-safe hash to hold Mcfly's data.
  def self.mcfly_store
    Thread.current[:mcfly] ||= {}
  end
end

ActiveSupport.on_load(:active_record) do
  include Delorean::Model
  include McFly::Model
end

ActiveSupport.on_load(:action_controller) do
  include Mcfly::Controller
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mcfly-0.0.4 lib/mcfly.rb
mcfly-0.0.3 lib/mcfly.rb
mcfly-0.0.2 lib/mcfly.rb
mcfly-0.0.1 lib/mcfly.rb