trx_ext 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe0b8730162b6a7b40a414a5908f7c5f367d6e568dd34c866fd39a110795dab0
4
- data.tar.gz: 7c2cbe1c8408af9483b146fa790d76587fa2359c3eaf8b6a2df1d626a0a1e988
3
+ metadata.gz: a28c9749e98f72553e2ca37963009fcc8ddf841f6930cc7ad6d71ba403650b2c
4
+ data.tar.gz: c45c63fdd16cb43c12d6fa6927e2d66436cb94f7b657062e0c97e92d4671c09e
5
5
  SHA512:
6
- metadata.gz: 82c905a21cf425a37d1c6805be3887df26b7d14abf05026784215ddcbe77948c66c14a879f351bc8481f2b80fcba29c5bfe394f931bd8c0d1b6c55ad903ddfb9
7
- data.tar.gz: 93e3fcc50fa330e972ebffdb5b068357ffbb4dac1bf64d83bd0e1f4d67260d73f665dddef1752d2ff9d085bf56b7d08dd252f797bbe9158e6038282f1f086377
6
+ metadata.gz: 94b03b1b7a7a003a068da0799ab8de8bf594d4503f9eb763a0f68cfec3c98f8c2a90c43cf836ee42b4b31c90b872f218781ca60068dedfd10b1eb4a520d90c50
7
+ data.tar.gz: b825acd8dc75edbfb351d02a5ce622a6d75bad5b2dc1a14a011c255b31cac6afb007ee46769272d24113dacf78cafe1882af6ce0aad94e0d6fad755d1eb434d6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Nothing new yet
4
4
 
5
+ ## [1.0.2] - 2022-01-27
6
+
7
+ - Add support of ActiveRecord `7.0.1`
8
+
5
9
  ## [1.0.1] - 2021-12-26
6
10
 
7
11
  - Add support of ActiveRecord `6.0.4.4`, `6.1.4.4` and `7.0.0`
@@ -5,29 +5,32 @@ module TrxExt
5
5
  # Wraps specified method in an +ActiveRecord+ transaction.
6
6
  #
7
7
  # @example
8
- # class Tilapia < Symbology::Base
9
- # wrap_in_trx def gnosis(number)
10
- # introspect(number, string.numerology(:kabbalah).sum)
8
+ # class User < ActiveRecord::Base
9
+ # class << self
10
+ # wrap_in_trx def find_or_create(name)
11
+ # user = find_by(name: name)
12
+ # user ||= create(name: name, title: 'Default')
13
+ # user
14
+ # end
11
15
  # end
12
16
  # end
13
17
  #
14
- # order = Tilapia.new
15
- # order.gnosis(93)
18
+ # User.find_or_create('some name')
16
19
  # # (0.6ms) BEGIN
17
- # # Introspection Load (0.4ms) SELECT "introspections".* FROM "introspections" WHERE "introspections"."id" = $1 LIMIT 1 [["id", 93]]
20
+ # # User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = $1 LIMIT 1 [["name", 'some name']]
21
+ # # User Create (1.8 ms) INSERT INTO "users" ("name", "title") VALUES ($1, $2) RETURNING "id" [["name", "some name"], ["title", "Default"]]
18
22
  # # (0.2ms) COMMIT
19
- # # => 418
20
23
  #
21
24
  # @param method [Symbol] a name of the method
22
25
  # @return [Symbol]
23
26
  def wrap_in_trx(method)
24
27
  module_to_prepend = Module.new do
25
28
  class_eval <<-RUBY, __FILE__, __LINE__ + 1
26
- def #{method}(...)
27
- trx do
28
- super
29
+ def #{method}(...)
30
+ trx do
31
+ super
32
+ end
29
33
  end
30
- end
31
34
  RUBY
32
35
  end
33
36
  prepend module_to_prepend
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TrxExt
4
- VERSION = "1.0.2"
5
- SUPPORTED_AR_VERSIONS = %w(6.0.4.4 6.1.4.4 7.0.1).freeze
4
+ VERSION = "1.0.3"
5
+ SUPPORTED_AR_VERSIONS = %w(6.0.4.7 6.1.5 7.0.2.3).freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trx_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Dzyzenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-27 00:00:00.000000000 Z
11
+ date: 2022-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -143,8 +143,8 @@ licenses:
143
143
  metadata:
144
144
  allowed_push_host: https://rubygems.org
145
145
  homepage_uri: https://github.com/intale/trx_ext
146
- source_code_uri: https://github.com/intale/trx_ext/tree/v1.0.2
147
- changelog_uri: https://github.com/intale/trx_ext/blob/v1.0.2/CHANGELOG.md
146
+ source_code_uri: https://github.com/intale/trx_ext/tree/v1.0.3
147
+ changelog_uri: https://github.com/intale/trx_ext/blob/v1.0.3/CHANGELOG.md
148
148
  post_install_message:
149
149
  rdoc_options: []
150
150
  require_paths: