rspec-activerecord-formatter 1.2.0 → 1.3.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
- SHA256:
3
- metadata.gz: db1b2dbddfb326ac8143998c1b7cc204d90d84f83ccfabe9f3cc022d435a49d8
4
- data.tar.gz: 7f29a63684b8e1ce6614e99cbf6ad978739f2f08357d14abc7a4209f2fd866ea
2
+ SHA1:
3
+ metadata.gz: '08dd87f7aa390ba4918b877798c35de853c02243'
4
+ data.tar.gz: f4e7986bc385496bdc26213995fb109765be26fd
5
5
  SHA512:
6
- metadata.gz: 9f7f871268d7ce2c007d1bede488b073e443ee5e93ae6ed9f07ca7e787811b2bd38d373ca5843c34403dc877942c1b7908f83ed9729f6c5010f71801dbced20d
7
- data.tar.gz: 5dc551ee718ce1fdd0e5ce8997f105750b2295d2e7a9b14e399acce10ee5a17be8a07b76bd51c8d21c30b8c2278337b224cb0d8dda5916977f8082040e72a07a
6
+ metadata.gz: 740c19e2671ea78b0460fd83a3f1c08ef4c40fa120bf495fff54bd7970a5bca3c9144e128542b54e6c1606dbbc8ac52b153d6d00b37618a479d0881e8acd1264
7
+ data.tar.gz: b2e55d67fc0b296e847f75c20ec6a6352f871322ccb0403c9f56ccbd0a2b4ad23db44b99f7c87f6b041b03c4e9a7caf19165d9ac8742bd911292d91719247c82
@@ -69,6 +69,16 @@ module ActiveRecordFormatterHelpers
69
69
  def inc_query_name(data)
70
70
  name = data[:name] || "Unnamed"
71
71
 
72
+ # In older versions of Rails, insert statements are just counted as SQL
73
+ # queries, which means that all the queries are just bunchedup at the top.
74
+ # Makes this data pretty useless. So anyway, try to suss out a name for
75
+ # at least those insertions (which are much more frequent than, say,
76
+ # updates in a test suite anyway).
77
+ if data[:name] == "SQL" && query_is_an_insert?(data[:sql])
78
+ table = data[:sql].scan(/INSERT INTO "(\w+)"/).first.first
79
+ name = "#{table} Create"
80
+ end
81
+
72
82
  query_names[name] += 1
73
83
  end
74
84
 
@@ -6,7 +6,7 @@ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
6
6
  Gem::Specification.new do |gem|
7
7
 
8
8
  gem.name = "rspec-activerecord-formatter"
9
- gem.version = "1.2.0"
9
+ gem.version = "1.3.0"
10
10
 
11
11
  gem.summary = "Adds object creations and queries to Rspec output."
12
12
  gem.description = "Creates a new formatter for ActiveRecord that can help you diagnose performance issues in RSpec"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-activerecord-formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Mastey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-20 00:00:00.000000000 Z
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.7.3
101
+ rubygems_version: 2.6.13
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Adds object creations and queries to Rspec output.