active_record_mysql_repl 0.1.10 → 0.1.12

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: bc6057054c8114485382602e279c5d7c1eb8f3f0c225b942d3125e5b62df6688
4
- data.tar.gz: 49adaec14aee3fcad06c5bcf92a8a8e27c4432a3a1f06bcd82800b143476c85c
3
+ metadata.gz: fb8ee6363c8b678044b161c2226a2c8f3260797b1f6373d29ccf444149219504
4
+ data.tar.gz: 0cb27fd8dc02ce73834a56985ef10b6b6a8aafdb7bb429c399d4bd9f17c22f69
5
5
  SHA512:
6
- metadata.gz: ffbc9edfbf0a5009bfbea07bc22a5183f86f8a20190e49cdb27de93edd17dee0c0b7105917cf10878938ed1921f7fb51dc1394227fd019c3e3a4911bc3de4c4f
7
- data.tar.gz: 59be53bab4414aba315cbdddf9a93f9ebebba4bea987e26037eea4dcd92fde5586b983a4b364a9b585dd0ab7480531eb578ca5a7851e5cc071a2e3b9b1138f6e
6
+ metadata.gz: b029d35e7f40a62adccecbf47bc2a0262c4ed83386408252e79d4d05910eb45d268564ba4ffbc1ad63f0552232bf456a44fab0d6172ab03d94831a92eaeb44d6
7
+ data.tar.gz: f726cefaad6d521c3d44a5f6df61f63fec00d7ed065d8215b54afe29ec0f2196b65b27419ecb2aef8feeb137855a3dfaa902a6c079a88e3bd71f0c0909bec1bc
@@ -18,17 +18,15 @@ module ActiverecordMysqlRepl
18
18
  end
19
19
 
20
20
  arr = arr.map do |e|
21
- if e.is_a?(::ActiveRecord::Base)
22
- values = e.attributes.transform_values do |v|
23
- next JSON.pretty_generate(v) if v.is_a?(Enumerable) && v.size > 0
24
- next v.to_time if v.is_a?(Time) || v.is_a?(Date)
25
- next "NULL" if v.nil?
26
- next '""' if v == ""
27
- v.to_s
28
- end
29
- next values
21
+ e = e.attributes if e.is_a?(::ActiveRecord::Base)
22
+ next e unless e.is_a?(Hash)
23
+ next e.transform_values do |v|
24
+ next JSON.pretty_generate(v) if v.is_a?(Enumerable) && v.size > 0
25
+ next v.to_time if v.is_a?(Time) || v.is_a?(Date)
26
+ next "NULL" if v.nil?
27
+ next '""' if v == ""
28
+ v.to_s
30
29
  end
31
- e
32
30
  end
33
31
 
34
32
  raise "#{arr} is not an array of hash".red unless arr.all? { |e| e.is_a?(Hash) }
@@ -79,16 +77,15 @@ module ActiverecordMysqlRepl
79
77
  end
80
78
 
81
79
  arr = arr.map do |e|
82
- if e.is_a?(::ActiveRecord::Base)
83
- values = e.attributes.transform_values do |v|
84
- next JSON.pretty_generate(v) if v.is_a?(Enumerable) && v.size > 0
85
- next "NULL" if v.nil?
86
- next '""' if v == ""
87
- v.to_s
88
- end
89
- next values
80
+ e = e.attributes if e.is_a?(::ActiveRecord::Base)
81
+ next e unless e.is_a?(Hash)
82
+ next e.transform_values do |v|
83
+ next JSON.pretty_generate(v) if v.is_a?(Enumerable) && v.size > 0
84
+ next v.to_time if v.is_a?(Time) || v.is_a?(Date)
85
+ next "NULL" if v.nil?
86
+ next '""' if v == ""
87
+ v.to_s
90
88
  end
91
- e
92
89
  end
93
90
 
94
91
  raise "#{arr} is not an array of hash".red unless arr.all? { |e| e.is_a?(Hash) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordMysqlRepl
4
- VERSION = "0.1.10"
4
+ VERSION = "0.1.12"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_mysql_repl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Kishi
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-01 00:00:00.000000000 Z
10
+ date: 2025-04-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: byebug