Sha256: 19e246d6312474296ed98a7c244270611c8958ba47d889ff70beee31adf3abbd

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

require 'after_commit/active_record'
require 'after_commit/connection_adapters'

module AfterCommit
  def self.committed_records
    @@committed_records ||= []
  end

  def self.committed_records=(committed_records)
    @@committed_records = committed_records
  end
  
  def self.committed_records_on_create
    @@committed_records_on_create ||= []
  end
  
  def self.committed_records_on_create=(committed_records)
    @@committed_records_on_create = committed_records
  end
  
  def self.committed_records_on_update
    @@committed_records_on_update ||= []
  end
  
  def self.committed_records_on_update=(committed_records)
    @@committed_records_on_update = committed_records
  end
  
  def self.committed_records_on_destroy
    @@committed_records_on_destroy ||= []
  end
  
  def self.committed_records_on_destroy=(committed_records)
    @@committed_records_on_destroy = committed_records
  end
end

ActiveRecord::Base.send(:include, AfterCommit::ActiveRecord)

Object.subclasses_of(ActiveRecord::ConnectionAdapters::AbstractAdapter).each do |klass|
  klass.send(:include, AfterCommit::ConnectionAdapters)
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
freelancing-god-thinking-sphinx-1.1.5 vendor/after_commit/lib/after_commit.rb
freelancing-god-thinking-sphinx-1.1.6 vendor/after_commit/lib/after_commit.rb
lostboy-thinking-sphinx-1.1.5.1 vendor/after_commit/lib/after_commit.rb
lostboy-thinking-sphinx-1.1.5.2 vendor/after_commit/lib/after_commit.rb
lostboy-thinking-sphinx-1.1.5.3 vendor/after_commit/lib/after_commit.rb
lostboy-thinking-sphinx-1.1.5.4 vendor/after_commit/lib/after_commit.rb
lostboy-thinking-sphinx-1.1.5.5 vendor/after_commit/lib/after_commit.rb