fix: reduce number of n+1 queries

rpp-main
Nelson Jovel 2 years ago
parent 31c40297d3
commit 77193cdf35

@ -1 +1 @@
3.2.2 3.3.0

@ -1,5 +1,5 @@
source "https://rubygems.org" source "https://rubygems.org"
ruby "3.2.2" ruby "3.3.0"
git_source(:github) do |repo_name| git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")

@ -104,11 +104,12 @@ GEM
parser (>= 2.4) parser (>= 2.4)
smart_properties smart_properties
bigdecimal (3.1.5) bigdecimal (3.1.5)
bootsnap (1.17.0) bootsnap (1.17.1)
msgpack (~> 1.2) msgpack (~> 1.2)
brakeman (6.1.0) brakeman (6.1.1)
racc
builder (3.2.4) builder (3.2.4)
bullet (7.1.4) bullet (7.1.5)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
uniform_notifier (~> 1.11) uniform_notifier (~> 1.11)
byebug (11.1.3) byebug (11.1.3)
@ -145,6 +146,33 @@ GEM
railties (>= 3.2) railties (>= 3.2)
drb (2.2.0) drb (2.2.0)
ruby2_keywords ruby2_keywords
dry-configurable (1.1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-schema (1.13.3)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
dry-types (1.7.2)
bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
e2mmap (0.1.0) e2mmap (0.1.0)
ed25519 (1.3.0) ed25519 (1.3.0)
em-websocket (0.5.3) em-websocket (0.5.3)
@ -160,9 +188,9 @@ GEM
erblint-github (0.5.1) erblint-github (0.5.1)
erubi (1.12.0) erubi (1.12.0)
eventmachine (1.2.7) eventmachine (1.2.7)
factory_bot (6.4.2) factory_bot (6.4.5)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
factory_bot_rails (6.4.2) factory_bot_rails (6.4.3)
factory_bot (~> 6.4) factory_bot (~> 6.4)
railties (>= 5.0.0) railties (>= 5.0.0)
ferrum (0.14) ferrum (0.14)
@ -199,18 +227,17 @@ GEM
i18n (1.14.1) i18n (1.14.1)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
io-console (0.7.1) io-console (0.7.1)
irb (1.10.1) irb (1.11.1)
rdoc rdoc
reline (>= 0.3.8) reline (>= 0.4.2)
jaro_winkler (1.5.6) jaro_winkler (1.5.6)
jsbundling-rails (1.2.1) jsbundling-rails (1.2.2)
railties (>= 6.0.0) railties (>= 6.0.0)
json (2.7.1) json (2.7.1)
kramdown (2.4.0) kramdown (2.4.0)
rexml rexml
kramdown-parser-gfm (1.1.0) kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0) kramdown (~> 2.0)
kwalify (0.7.2)
language_server-protocol (3.17.0.3) language_server-protocol (3.17.0.3)
launchy (2.5.2) launchy (2.5.2)
addressable (~> 2.8) addressable (~> 2.8)
@ -230,13 +257,13 @@ GEM
matrix (0.4.2) matrix (0.4.2)
method_source (1.0.0) method_source (1.0.0)
mini_mime (1.1.5) mini_mime (1.1.5)
minitest (5.20.0) minitest (5.21.1)
msgpack (1.7.2) msgpack (1.7.2)
multi_json (1.15.0) multi_json (1.15.0)
mutex_m (0.2.0) mutex_m (0.2.0)
nenv (0.3.0) nenv (0.3.0)
nested_scaffold (1.1.0) nested_scaffold (1.1.0)
net-imap (0.4.8) net-imap (0.4.9.1)
date date
net-protocol net-protocol
net-pop (0.1.2) net-pop (0.1.2)
@ -245,24 +272,23 @@ GEM
timeout timeout
net-sftp (4.0.0) net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0) net-ssh (>= 5.0.0, < 8.0.0)
net-smtp (0.4.0) net-smtp (0.4.0.1)
net-protocol net-protocol
net-ssh (7.2.1) net-ssh (7.2.1)
newrelic_rpm (9.6.0) newrelic_rpm (9.7.0)
base64
nio4r (2.7.0) nio4r (2.7.0)
nokogiri (1.15.5-arm64-darwin) nokogiri (1.16.0-arm64-darwin)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.15.5-x86_64-darwin) nokogiri (1.16.0-x86_64-darwin)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux) nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4) racc (~> 1.4)
notiffany (0.1.3) notiffany (0.1.3)
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.0)
orm_adapter (0.5.0) orm_adapter (0.5.0)
parallel (1.24.0) parallel (1.24.0)
parallel_tests (4.3.0) parallel_tests (4.4.0)
parallel parallel
parser (3.2.2.4) parser (3.2.2.4)
ast (~> 2.4.1) ast (~> 2.4.1)
@ -274,7 +300,7 @@ GEM
psych (5.1.2) psych (5.1.2)
stringio stringio
public_suffix (5.0.4) public_suffix (5.0.4)
puma (6.4.0) puma (6.4.2)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.7.3) racc (1.7.3)
rack (3.0.8) rack (3.0.8)
@ -330,12 +356,13 @@ GEM
rbs (2.8.4) rbs (2.8.4)
rdoc (6.6.2) rdoc (6.6.2)
psych (>= 4.0.0) psych (>= 4.0.0)
reek (6.1.4) reek (6.2.0)
kwalify (~> 0.7.0) dry-schema (~> 1.13.0)
parser (~> 3.2.0) parser (~> 3.2.0)
rainbow (>= 2.0, < 4.0) rainbow (>= 2.0, < 4.0)
regexp_parser (2.8.3) rexml (~> 3.1)
reline (0.3.9) regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5) io-console (~> 0.5)
responders (3.1.1) responders (3.1.1)
actionpack (>= 5.2) actionpack (>= 5.2)
@ -423,7 +450,7 @@ GEM
activesupport (>= 5.2) activesupport (>= 5.2)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
standard_deviation (1.0.3) standard_deviation (1.0.3)
stimulus-rails (1.3.0) stimulus-rails (1.3.3)
railties (>= 6.0.0) railties (>= 6.0.0)
stringio (3.1.0) stringio (3.1.0)
thor (1.3.0) thor (1.3.0)
@ -508,7 +535,7 @@ DEPENDENCIES
watir watir
RUBY VERSION RUBY VERSION
ruby 3.2.2p53 ruby 3.3.0p0
BUNDLED WITH BUNDLED WITH
2.3.3 2.3.3

@ -37,6 +37,6 @@ class OverviewController < SqmApplicationController
end end
def categories def categories
@categories ||= Category.sorted.includes(%i[measures scales admin_data_items subcategories]) @categories ||= Category.sorted.includes(%i[measures admin_data_items subcategories])
end end
end end

@ -9,5 +9,4 @@ class Category < ActiveRecord::Base
has_many :subcategories has_many :subcategories
has_many :measures, through: :subcategories has_many :measures, through: :subcategories
has_many :admin_data_items, through: :measures has_many :admin_data_items, through: :measures
has_many :scales, through: :subcategories
end end

Loading…
Cancel
Save