From ce943a949849a00c8d6d8977142f0f8b49be1b56 Mon Sep 17 00:00:00 2001 From: trainingAndreiTanase Date: Sat, 17 Jun 2023 14:20:14 +0300 Subject: [PATCH 1/3] Update Gemfile.lock --- .idea/.gitignore | 8 +++ .idea/golfr_backend.iml | 117 ++++++++++++++++++++++++++++++++++++++++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 +++ Gemfile.lock | 1 + 6 files changed, 144 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/golfr_backend.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/golfr_backend.iml b/.idea/golfr_backend.iml new file mode 100644 index 0000000..e5c7b11 --- /dev/null +++ b/.idea/golfr_backend.iml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..403d803 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c8000c8 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 982a4b6..bcd0bc3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -229,6 +229,7 @@ GEM PLATFORMS x86_64-darwin-20 + x86_64-darwin-22 DEPENDENCIES bootsnap (>= 1.4.4) From 39d28cdef28632e7ab7c2ac0bd69e5e6168d0ee7 Mon Sep 17 00:00:00 2001 From: trainingAndreiTanase Date: Sat, 17 Jun 2023 14:21:50 +0300 Subject: [PATCH 2/3] Switch from lazy load to eager load --- app/controllers/api/scores_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/scores_controller.rb b/app/controllers/api/scores_controller.rb index cbed318..c4bf1d2 100644 --- a/app/controllers/api/scores_controller.rb +++ b/app/controllers/api/scores_controller.rb @@ -5,7 +5,7 @@ class ScoresController < ApplicationController before_action :validate_score_user_id, only: :destroy def user_feed - scores = Score.all.order(played_at: :desc, id: :desc) + scores = Score.all.order(played_at: :desc, id: :desc).includes(:user) serialized_scores = scores.map(&:serialize) response = { @@ -55,4 +55,4 @@ def validate_score_user_id }, status: :unauthorized end end -end +end \ No newline at end of file From 127c622bd06835e07187141e925d0283e7a02676 Mon Sep 17 00:00:00 2001 From: trainingAndreiTanase Date: Tue, 20 Jun 2023 12:16:14 +0300 Subject: [PATCH 3/3] Solve comments --- .idea/.gitignore | 8 -- .idea/golfr_backend.iml | 117 ----------------------- .idea/misc.xml | 4 - .idea/modules.xml | 8 -- .idea/vcs.xml | 6 -- app/controllers/api/scores_controller.rb | 2 +- 6 files changed, 1 insertion(+), 144 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/golfr_backend.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/golfr_backend.iml b/.idea/golfr_backend.iml deleted file mode 100644 index e5c7b11..0000000 --- a/.idea/golfr_backend.iml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 403d803..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index c8000c8..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/controllers/api/scores_controller.rb b/app/controllers/api/scores_controller.rb index c4bf1d2..5e95873 100644 --- a/app/controllers/api/scores_controller.rb +++ b/app/controllers/api/scores_controller.rb @@ -55,4 +55,4 @@ def validate_score_user_id }, status: :unauthorized end end -end \ No newline at end of file +end