rails-crud-tools 0.4.3 → 0.5.0

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: '008fdf2673bcbae231ccc376ca9fdf1c7647ea2df3a3a5037e6beb60d4b67728'
4
- data.tar.gz: c8006b6be02b313626f05cf021a3264a555ed54314f60c3e349aabdc680e28b4
3
+ metadata.gz: b5f67e7e466a9b26e7ddf8a539d276694c0ad188117fc6b6719739b923a3577e
4
+ data.tar.gz: e684b41c0054a02162343721f290e3c77bd5d73a48302faed1858716a4c14fa7
5
5
  SHA512:
6
- metadata.gz: 5f7b3dd252dad14b4e262d33e6f7c79fb784e791739ba0d74adb33fb6187f473d84d314c342f897ea97670b215bd8811a36195b070642252990f9f26d6adb142
7
- data.tar.gz: fe6df88290d5132775d2e796e9a2b80f01ec3409f5ffc1b7c9438b4993f16681bd5e4c06e63cc91d46e4b31f8f5a8f8e7c707d9acfbde428d4f3faa4637773a5
6
+ metadata.gz: e7dbb6a30981ee535a3656a80e88281d899d0b4271580e2920aedf670bfa846a2a4c0f4cb739a31ff016cb763bf6a491ceae34125a4b69b4885135b408a59091
7
+ data.tar.gz: db890338796f0430d4502a198c8f9ecb54184188b189ecdbefc4a4cb194b61761ca4c68e4e949cdff1801ecab103af135ffd918ad76439edb9f0c7b3365a75a8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [0.5.0] - 2025-01-07
2
+ - Multiple table support
3
+
1
4
  ## [0.4.3] - 2025-01-07
2
5
  - Refactored `crud_notifications.rb`.
3
6
  - Modified to not execute the `setup` method in `tools.rb` when running commands.
@@ -32,22 +32,23 @@ module Rails
32
32
  else "Unknown"
33
33
  end
34
34
 
35
- match_data = data[:sql].match(/(?:INSERT INTO|UPDATE|DELETE FROM|FROM)\s+`?(\w+)`?/i)
36
- unless match_data
35
+ table_names = data[:sql].scan(/(?:INSERT INTO|UPDATE|DELETE FROM|FROM|JOIN)\s+`?(\w+)`?(?:\s*,\s*`?(\w+)`?)*/i).flatten.compact
36
+ if table_names.empty?
37
37
  # テーブル名が見つからない場合は警告を出力
38
38
  CrudLogger.logger.warn "Table name not found in SQL: #{data[:sql]}"
39
39
  return
40
40
  end
41
41
 
42
- # テーブル名を取得して CRUD 操作に追加
43
- table_name = match_data[1]
44
42
  key, method = determine_key_and_method
45
43
  if key.nil? || method.nil?
46
44
  CrudLogger.logger.warn "Request not found. #{data[:name]} - #{data[:sql]}"
47
45
  return
48
46
  end
49
47
 
50
- CrudOperations.instance.add_operation(method, key, table_name, operation)
48
+ # テーブル名を取得して CRUD 操作に追加
49
+ table_names.each do |table_name|
50
+ CrudOperations.instance.add_operation(method, key, table_name, operation)
51
+ end
51
52
 
52
53
  return unless CrudConfig.instance.sql_logging_enabled
53
54
 
@@ -3,7 +3,7 @@
3
3
  module Rails
4
4
  module Crud
5
5
  module Tools
6
- VERSION = "0.4.3"
6
+ VERSION = "0.5.0"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-crud-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yhijikata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-06 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord