Skip to content

Commit

Permalink
Fix: Fix variants relation
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Jan 25, 2024
1 parent aba1f3a commit 0f8e4e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/app/controllers/api/charts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def all

charts =
Chart
.preload(%i[author co_authors variants tags])
.preload(%i[author co_authors tags])
.limit(length)
.offset(params[:offset].to_i || 0)
.where(**cond)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/models/chart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Chart < ApplicationRecord
enum :visibility, VISIBILITY, prefix: "visibility"

def self.include_all
preload(%i[author co_authors variants tags file_resources]).merge(
preload(%i[author co_authors _variants tags file_resources]).merge(
FileResource.with_attached_file
)
end
Expand Down

0 comments on commit 0f8e4e4

Please sign in to comment.