Skip to content

Commit fe5c52e

Browse files
dhernandez-quoinpnabutovsky
authored andcommitted
Merged in r2-3104-system-settings-performance (pull request #6996)
R2-3104 - System Settings API performance
2 parents 8a60c82 + e7b4aef commit fe5c52e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/controllers/api/v2/system_settings_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Api::V2::SystemSettingsController < ApplicationApiController
77
def index
88
@system_setting = SystemSettings.first
99
@primero_modules = extended? ? PrimeroModule.all : []
10-
@agencies = extended? ? Agency.all : []
10+
@agencies = extended? ? extended_agencies : []
1111
end
1212

1313
def model_class
@@ -17,4 +17,8 @@ def model_class
1717
def extended?
1818
params[:extended] == 'true'
1919
end
20+
21+
def extended_agencies
22+
Agency.includes(logo_full_attachment: :blob, logo_icon_attachment: :blob, terms_of_use_attachment: :blob).all
23+
end
2024
end

0 commit comments

Comments
 (0)