ar_transaction_changes 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/Appraisals +1 -1
- data/README.md +8 -2
- data/gemfiles/rails_4_2.gemfile +1 -1
- data/lib/ar_transaction_changes.rb +2 -2
- data/lib/ar_transaction_changes/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d955fbf768a1e7ee34f34f116e57391650cd3c36
|
4
|
+
data.tar.gz: d0ebf9173f2b24e511564694b884d2109dab6ef7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d07c753b3c0e2dbc84b4914aadf47457541b2c494d6f7d3f9754d798e769bf09303b078b747b0fc1804639374ee1e74d411e1221a9c0253fe50748c2cc554a7d
|
7
|
+
data.tar.gz: f02d83027de58832ebdad0f4ce65dc7c759ee7f885669e5228b48a065475a6c2d8218e229b301bf2262cd434da80d879ec03a5490333de6a406b35e207d928b5
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
# ArTransactionChanges
|
2
2
|
[![Build Status](https://travis-ci.org/dylanahsmith/ar_transaction_changes.png?branch=master)](https://travis-ci.org/dylanahsmith/ar_transaction_changes)
|
3
3
|
|
4
|
-
Store
|
5
|
-
are available in an after_commit callbacks.
|
4
|
+
Store all attribute changes for active record objects during a
|
5
|
+
transaction so that they are available in an after_commit callbacks.
|
6
|
+
|
7
|
+
Note that using previous_changes in an after_commit hook will only
|
8
|
+
return the attribute changes from the last time the record was
|
9
|
+
saved, which won't include all the changes made to the record in
|
10
|
+
the transaction if the record was saved multiple times in the same
|
11
|
+
transaction. Use this gem to solve this problem.
|
6
12
|
|
7
13
|
## Installation
|
8
14
|
|
data/gemfiles/rails_4_2.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "ar_transaction_changes/version"
|
2
2
|
|
3
3
|
module ArTransactionChanges
|
4
|
-
if
|
4
|
+
if ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 2 && ActiveRecord::VERSION::TINY != 3
|
5
5
|
def _run_create_callbacks
|
6
6
|
ret = super
|
7
7
|
store_transaction_changed_attributes if ret != false
|
@@ -26,7 +26,7 @@ module ArTransactionChanges
|
|
26
26
|
@transaction_changed_attributes = nil
|
27
27
|
end
|
28
28
|
else
|
29
|
-
def run_callbacks(kind)
|
29
|
+
def run_callbacks(kind, *args)
|
30
30
|
ret = super
|
31
31
|
case kind.to_sym
|
32
32
|
when :create, :update
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_transaction_changes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Thacker-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|