transaction_changes 2.0 → 2.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: 042210a68d9eb725556cbfacfd7cd0882251c2ee
4
- data.tar.gz: 7d348977283b663b0aeb43cc0902c19830f1b39f
3
+ metadata.gz: 8fed12bd13bb6d0513d3eb26237dc3a118c60f52
4
+ data.tar.gz: 22c7dfc663f82ad59736343a6893a82172498dc1
5
5
  SHA512:
6
- metadata.gz: 93d40641aa3b471b4dde7d95987bbd3307ad45471f4e4a610a6ae88574aabaf660e0539c70982f5c45fadb89f3d5fd80a30fd0dba44f8e30b57279683d1bc020
7
- data.tar.gz: b7c573e907f6b97e8bf51c5fe155132a85c90dca6098559ae306d1b9ffead7971960b361eac4f203b17815abe810f3d115cffebffb2fa71cb60ddae0b95c9f26
6
+ metadata.gz: 035145aa0ffd50636c6c716049d9bf37e7eab1f130664ecfced34fc61087a099a4c8d6b85d249cfb3a3a0978b7351d9471e6ac7fd16b5863dff20ea11bb0a3f3
7
+ data.tar.gz: 40c3b2b0232cc1fd02cad10d3d89c6587eadeb679ec7def959bf93e1a2e55eaf0f140fb733a2c2b6a82012de2c64e5fb70cef34029fc598c95c83033e8179de4
data/Gemfile.lock CHANGED
@@ -1,12 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transaction_changes (0.1.0)
4
+ transaction_changes (2.0)
5
+ activesupport
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
10
+ activesupport (4.2.10)
11
+ i18n (~> 0.7)
12
+ minitest (~> 5.1)
13
+ thread_safe (~> 0.3, >= 0.3.4)
14
+ tzinfo (~> 1.1)
15
+ concurrent-ruby (1.0.5)
9
16
  diff-lcs (1.3)
17
+ i18n (0.9.5)
18
+ concurrent-ruby (~> 1.0)
19
+ minitest (5.11.3)
10
20
  rake (10.5.0)
11
21
  rspec (3.7.0)
12
22
  rspec-core (~> 3.7.0)
@@ -21,6 +31,9 @@ GEM
21
31
  diff-lcs (>= 1.2.0, < 2.0)
22
32
  rspec-support (~> 3.7.0)
23
33
  rspec-support (3.7.1)
34
+ thread_safe (0.3.6)
35
+ tzinfo (1.2.5)
36
+ thread_safe (~> 0.1)
24
37
 
25
38
  PLATFORMS
26
39
  ruby
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # TransactionChanges
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/transaction_changes`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem stores attribute changes of a model during ActiveRecord Transaction so that they are available in an after_commit callbacks.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,22 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ```ruby
24
+ class Profile < ActiveRecord::Base
25
+
26
+ after_commit :handle_callback
27
+
28
+ include TransactionChanges
29
+
30
+ def handle_callback
31
+ puts transaction_changes
32
+ end
33
+ end
34
+ ```
35
+
36
+ ## Important Notes
37
+
38
+ `include TransactionChanges` should be written after all the after_commit callbacks
26
39
 
27
40
  ## Development
28
41
 
@@ -32,7 +45,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
45
 
33
46
  ## Contributing
34
47
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/transaction_changes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
48
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Priyanka-Soni-id/transaction_changes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
49
 
37
50
  ## License
38
51
 
@@ -40,4 +53,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
53
 
41
54
  ## Code of Conduct
42
55
 
43
- Everyone interacting in the TransactionChanges project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/transaction_changes/blob/master/CODE_OF_CONDUCT.md).
56
+ Everyone interacting in the TransactionChanges project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Priyanka-Soni-id/transaction_changes/blob/master/CODE_OF_CONDUCT.md).
@@ -1,3 +1,3 @@
1
1
  module TransactionChanges
2
- VERSION = "2.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require "transaction_changes/version"
2
+ require 'active_support/concern'
2
3
 
3
4
  module TransactionChanges
4
5
  extend ActiveSupport::Concern
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "bundler", "~> 1.16"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
+ spec.add_dependency "activesupport"
29
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transaction_changes
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Priyanka
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: activesupport
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Store attribute changes during ActiveRecord Transaction
56
70
  email:
57
71
  - priyankatrancedi.iitd@gmail.com