ar_transaction_changes 1.0.0 → 1.0.1

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: a8ff2de126ba16e92f20b0104ecb175c2fcf81e0
4
- data.tar.gz: 5793e455b6b8f70bdf58e491b4e949148987ad38
3
+ metadata.gz: b76ac095327c8c254909a40073ea452d63697545
4
+ data.tar.gz: 678ec4927dc1820bc18f20487e4198207934bc31
5
5
  SHA512:
6
- metadata.gz: a65be870f0ee580c88027537aafc1e1e6d186596096bde3f5a98c6c6c0a418c1c1912279a76e7de6ee8fa5cd1f9d5f3675f63cd00fb7fed8f3d470076aa471df
7
- data.tar.gz: 67024564a43fb3c48d005f9e58a0a9029807aab97a36b7c4103cf63b8c32707065ddc99a31556c64d7cf0759891b00de365f84bdb0cb874f2affaeca2920daab
6
+ metadata.gz: d5bf2e245da73bf180d81e55a4c39841301d43d8a2ec440c5f69662f9335ac4dc776acf72efffc91acea4e1fe2cf26a097acab5c62720bc6d8ef139bd5a4841d
7
+ data.tar.gz: ac3c601561b34d03c56cafb1f4048e1d0e5e4096ccc590a7bed7b9ca45fad0b37f18608573c093c32a9022145ccace87df41c913945e667de823403f1b48b935
data/.travis.yml CHANGED
@@ -2,12 +2,13 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1.1
5
+ - 2.1.5
6
6
 
7
7
  gemfile:
8
8
  - gemfiles/rails_3_2.gemfile
9
- - gemfiles/rails_4_0_5.gemfile
10
- - gemfiles/rails_4_1_stable.gemfile
9
+ - gemfiles/rails_4_0.gemfile
10
+ - gemfiles/rails_4_1.gemfile
11
+ - gemfiles/rails_4_2.gemfile
11
12
 
12
13
  services:
13
14
  - mysql
data/Appraisals CHANGED
@@ -1,11 +1,15 @@
1
1
  appraise "rails-3-2" do
2
- gem "rails", "~> 3.2"
2
+ gem "rails", "~> 3.2.21"
3
3
  end
4
4
 
5
- appraise "rails-4-0-5" do
6
- gem "rails", "4.0.5"
5
+ appraise "rails-4-0" do
6
+ gem "rails", "~> 4.0.12"
7
7
  end
8
8
 
9
- appraise "rails-4-1-stable" do
10
- gem "rails", "~> 4.1.1", github: 'rails/rails', branch: '4-1-stable'
9
+ appraise "rails-4-1" do
10
+ gem "rails", "~> 4.1.8"
11
+ end
12
+
13
+ appraise "rails-4-2" do
14
+ gem "rails", "~> 4.2.0.rc1"
11
15
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 3.2"
5
+ gem "rails", "~> 3.2.21"
6
6
 
7
7
  gemspec :path => "../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 4.1.1", :github => "rails/rails", :branch => "4-1-stable"
5
+ gem "rails", "~> 4.0.12"
6
6
 
7
7
  gemspec :path => "../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "4.0.5"
5
+ gem "rails", "~> 4.1.8"
6
6
 
7
7
  gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.2.0.rc1"
6
+
7
+ gemspec :path => "../"
@@ -1,16 +1,42 @@
1
1
  require "ar_transaction_changes/version"
2
2
 
3
3
  module ArTransactionChanges
4
- def run_callbacks(kind, &block)
5
- ret = super
6
- case kind.to_sym
7
- when :create, :update
4
+ if (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 4
5
+ def _run_create_callbacks
6
+ ret = super
8
7
  store_transaction_changed_attributes if ret != false
9
- when :commit, :rollback
8
+ ret
9
+ end
10
+
11
+ def _run_update_callbacks
12
+ ret = super
13
+ store_transaction_changed_attributes if ret != false
14
+ ret
15
+ end
16
+
17
+ def _run_commit_callbacks
18
+ super
19
+ ensure
10
20
  @transaction_changed_attributes = nil
11
21
  end
12
22
 
13
- ret
23
+ def _run_rollback_callbacks
24
+ super
25
+ ensure
26
+ @transaction_changed_attributes = nil
27
+ end
28
+ else
29
+ def run_callbacks(kind)
30
+ ret = super
31
+ case kind.to_sym
32
+ when :create, :update
33
+ store_transaction_changed_attributes if ret != false
34
+ when :commit, :rollback
35
+ @transaction_changed_attributes = nil
36
+ end
37
+
38
+ ret
39
+ end
14
40
  end
15
41
 
16
42
  def transaction_changed_attributes
@@ -1,3 +1,3 @@
1
1
  module ArTransactionChanges
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
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.0
4
+ version: 1.0.1
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-05-08 00:00:00.000000000 Z
11
+ date: 2014-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -89,8 +89,9 @@ files:
89
89
  - Rakefile
90
90
  - ar_transaction_changes.gemspec
91
91
  - gemfiles/rails_3_2.gemfile
92
- - gemfiles/rails_4_0_5.gemfile
93
- - gemfiles/rails_4_1_stable.gemfile
92
+ - gemfiles/rails_4_0.gemfile
93
+ - gemfiles/rails_4_1.gemfile
94
+ - gemfiles/rails_4_2.gemfile
94
95
  - lib/ar_transaction_changes.rb
95
96
  - lib/ar_transaction_changes/version.rb
96
97
  - test/database.yml.default