transdeal 0.2.0 → 0.2.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: 0495a222b802e45941f0bba502cd5d27f3661341
4
- data.tar.gz: 76c740368223f9fe1ec9c682c41c321dd1e45286
3
+ metadata.gz: b13228981483f9cc08900966014106501f0560c0
4
+ data.tar.gz: fd5ab256980a2b142e367731aa34b5712979a539
5
5
  SHA512:
6
- metadata.gz: 9a36463dc78bddd735817a2c886c68979a95b9ff9f81ec7849109cba1eee0cee5dd699b609e02a6b24a0fb108ada2a2528c585fa1312900e57bed7a10a247430
7
- data.tar.gz: 8b5ced3e33836a3692d6b0efd3bfaa0b7232c09224081178b3fdd4d7bbe314ff5d5c69957bcce55eab78faaa7042ffba2a3315d159361b1f00d77f8f6903a058
6
+ metadata.gz: 54067a97d683cc7fc53c6e5b3578408a1ce1c9cabbf464f8822568bcc88b08914771cda3467052985dbb6cde5f01df2c0c847e79f1e127f532fadd2c4e6c9452
7
+ data.tar.gz: faa3209ae34f9e989e86f48f4f4bc1bdf4f4fd4e0ec3e5cf9fdbcc30f98ee546fd0b3fed760fc7fc556b6db80a98856361ad987e808341ba05b8159c0efb0224
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- transdeal (0.2.0)
4
+ transdeal (0.2.1)
5
5
  activerecord (~> 3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -43,6 +43,30 @@ end
43
43
  The above will call a configured backend(s) with the last version of modified
44
44
  objects before the transaction is rolled back.
45
45
 
46
+ ### Explicit handlers
47
+
48
+ ```ruby
49
+ class CallbackHandler
50
+ def self.run(data)
51
+ puts data.inspect
52
+ end
53
+ end
54
+
55
+ Transdeal.transaction(users.main, callback: :callback_handler) do
56
+ users.main = :me
57
+ raise ActiveRecord::Rollback
58
+ end
59
+ ```
60
+
61
+ There are two keyword parameters currently accepted:
62
+
63
+ * `callback` — anything that can be converted to proc, or symbol for the class
64
+ name, or a string, or a class (the class must respond to one of
65
+ `[:store, :run, :perform_async, :perform, :call, :[]]`—tried
66
+ in descending order,) or hash `{receiver: ..., method: ...}`
67
+ * `skip_global_callbacks` — the callbacks configured through global
68
+ `Transdeal.configure` method will be skipped.
69
+
46
70
  ## Contributing
47
71
 
48
72
  Bug reports and pull requests are welcome on GitHub at https://github.com/am-kantox/transdeal. 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.
@@ -1,3 +1,3 @@
1
1
  module Transdeal
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transdeal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksei Matiushkin