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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b76ac095327c8c254909a40073ea452d63697545
4
- data.tar.gz: 678ec4927dc1820bc18f20487e4198207934bc31
3
+ metadata.gz: d955fbf768a1e7ee34f34f116e57391650cd3c36
4
+ data.tar.gz: d0ebf9173f2b24e511564694b884d2109dab6ef7
5
5
  SHA512:
6
- metadata.gz: d5bf2e245da73bf180d81e55a4c39841301d43d8a2ec440c5f69662f9335ac4dc776acf72efffc91acea4e1fe2cf26a097acab5c62720bc6d8ef139bd5a4841d
7
- data.tar.gz: ac3c601561b34d03c56cafb1f4048e1d0e5e4096ccc590a7bed7b9ca45fad0b37f18608573c093c32a9022145ccace87df41c913945e667de823403f1b48b935
6
+ metadata.gz: d07c753b3c0e2dbc84b4914aadf47457541b2c494d6f7d3f9754d798e769bf09303b078b747b0fc1804639374ee1e74d411e1221a9c0253fe50748c2cc554a7d
7
+ data.tar.gz: f02d83027de58832ebdad0f4ce65dc7c759ee7f885669e5228b48a065475a6c2d8218e229b301bf2262cd434da80d879ec03a5490333de6a406b35e207d928b5
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
+ sudo: false
3
+
2
4
  rvm:
3
5
  - 1.9.3
4
6
  - 2.0.0
data/Appraisals CHANGED
@@ -11,5 +11,5 @@ appraise "rails-4-1" do
11
11
  end
12
12
 
13
13
  appraise "rails-4-2" do
14
- gem "rails", "~> 4.2.0.rc1"
14
+ gem "rails", "~> 4.2.0"
15
15
  end
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 transaction changes for active record objects so that they
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 4.2.0.rc1"
5
+ gem "rails", "~> 4.2.0"
6
6
 
7
7
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  require "ar_transaction_changes/version"
2
2
 
3
3
  module ArTransactionChanges
4
- if (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 4
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
@@ -1,3 +1,3 @@
1
1
  module ArTransactionChanges
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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: 2014-12-02 00:00:00.000000000 Z
11
+ date: 2015-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord