ar_transaction_changes 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -15,3 +14,4 @@ spec/reports
15
14
  test/tmp
16
15
  test/version_tmp
17
16
  tmp
17
+ *.lock
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+
6
+ gemfile:
7
+ - gemfiles/rails32.gemfile
8
+ - gemfiles/rails4.gemfile
9
+
10
+ services:
11
+ - mysql
12
+
13
+ before_script:
14
+ - mysql -e 'create database ar_transaction_changes_test'
data/Appraisals ADDED
@@ -0,0 +1,7 @@
1
+ appraise "rails32" do
2
+ gem "rails", "~> 3.2"
3
+ end
4
+
5
+ appraise "rails4" do
6
+ gem "rails", "~> 4.0"
7
+ end
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
2
  require 'rake'
3
3
  require 'rake/testtask'
4
+ require 'appraisal'
4
5
 
5
6
  task :default => 'test'
6
7
 
@@ -6,7 +6,7 @@ require 'ar_transaction_changes/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "ar_transaction_changes"
8
8
  gem.version = ArTransactionChanges::VERSION
9
- gem.authors = ["Dylan Smith"]
9
+ gem.authors = ["Dylan Thacker-Smith"]
10
10
  gem.email = ["Dylan.Smith@shopify.com"]
11
11
  gem.description = %q{Solves the problem of trying to get all the changes to an object during a transaction in an after_commit callbacks.}
12
12
  gem.summary = %q{Store transaction changes for active record objects}
@@ -17,7 +17,9 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_dependency("activerecord", [">= 3.0.0"])
20
+ gem.add_dependency "activerecord", "~> 3.0", "< 5.0"
21
21
 
22
+ gem.add_development_dependency("rake")
22
23
  gem.add_development_dependency("mysql2")
24
+ gem.add_development_dependency("appraisal")
23
25
  end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.2"
6
+
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.0"
6
+
7
+ gemspec :path=>"../"
@@ -1,14 +1,16 @@
1
1
  require "ar_transaction_changes/version"
2
2
 
3
3
  module ArTransactionChanges
4
- def create(*)
5
- super.tap do |status|
4
+ create_or_update_suffix = ActiveRecord::VERSION::MAJOR <= 3 ? "" : "_record"
5
+
6
+ define_method :"create#{create_or_update_suffix}" do |*args|
7
+ super(*args).tap do |status|
6
8
  store_transaction_changed_attributes if status != false
7
9
  end
8
10
  end
9
11
 
10
- def update(*)
11
- super.tap do |status|
12
+ define_method :"update#{create_or_update_suffix}" do |*args|
13
+ super(*args).tap do |status|
12
14
  store_transaction_changed_attributes if status != false
13
15
  end
14
16
  end
@@ -1,3 +1,3 @@
1
1
  module ArTransactionChanges
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,32 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_transaction_changes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Dylan Smith
8
+ - Dylan Thacker-Smith
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-14 00:00:00.000000000 Z
12
+ date: 2013-09-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ - - <
20
23
  - !ruby/object:Gem::Version
21
- version: 3.0.0
24
+ version: '5.0'
22
25
  type: :runtime
23
26
  prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
+ - - <
34
+ - !ruby/object:Gem::Version
35
+ version: '5.0'
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
24
46
  version_requirements: !ruby/object:Gem::Requirement
25
47
  none: false
26
48
  requirements:
27
49
  - - ! '>='
28
50
  - !ruby/object:Gem::Version
29
- version: 3.0.0
51
+ version: '0'
30
52
  - !ruby/object:Gem::Dependency
31
53
  name: mysql2
32
54
  requirement: !ruby/object:Gem::Requirement
@@ -43,6 +65,22 @@ dependencies:
43
65
  - - ! '>='
44
66
  - !ruby/object:Gem::Version
45
67
  version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: appraisal
70
+ requirement: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
46
84
  description: Solves the problem of trying to get all the changes to an object during
47
85
  a transaction in an after_commit callbacks.
48
86
  email:
@@ -52,11 +90,15 @@ extensions: []
52
90
  extra_rdoc_files: []
53
91
  files:
54
92
  - .gitignore
93
+ - .travis.yml
94
+ - Appraisals
55
95
  - Gemfile
56
96
  - LICENSE.txt
57
97
  - README.md
58
98
  - Rakefile
59
99
  - ar_transaction_changes.gemspec
100
+ - gemfiles/rails32.gemfile
101
+ - gemfiles/rails4.gemfile
60
102
  - lib/ar_transaction_changes.rb
61
103
  - lib/ar_transaction_changes/version.rb
62
104
  - test/database.yml.default