Sha256: 24ed5972dfa3057b61f9c372c81a2c0f8fd2516b07b2d8ca468964d2c56a775b
Contents?: true
Size: 1.21 KB
Versions: 62
Compression:
Stored size: 1.21 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 if defined?(JRUBY_VERSION) and defined?(JdbcSpec::MySQL) JdbcSpec::MySQL.send :include, AfterCommit::ConnectionAdapters end
Version data entries
62 entries across 62 versions & 13 rubygems