Skip to content

Commit

Permalink
Add Active Storage 7.1 changes to manual with_attached_* scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilka2 committed Jan 29, 2025
1 parent c2d1c7b commit fce2bf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/controllers/blocked/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class UsersController < ApplicationController
def index
@blocks = @user.blocks_as_blocker
.joins(:blocked)
.includes(blocked: [:pseuds, { default_pseud: { icon_attachment: :blob } }])
.includes(blocked: [:pseuds, { default_pseud: { icon_attachment: { blob: {
variant_records: { image_attachment: :blob },
preview_image_attachment: { blob: { variant_records: { image_attachment: :blob } } }
} } } }])
.order(created_at: :desc).order(id: :desc).page(params[:page])

@pseuds = @blocks.map { |b| b.blocked.default_pseud }
Expand Down
5 changes: 4 additions & 1 deletion app/controllers/muted/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class UsersController < ApplicationController
def index
@mutes = @user.mutes_as_muter
.joins(:muted)
.includes(muted: [:pseuds, { default_pseud: { icon_attachment: :blob } }])
.includes(muted: [:pseuds, { default_pseud: { icon_attachment: { blob: {
variant_records: { image_attachment: :blob },
preview_image_attachment: { blob: { variant_records: { image_attachment: :blob } } }
} } } }])
.order(created_at: :desc).order(id: :desc).page(params[:page])

@pseuds = @mutes.map { |b| b.muted.default_pseud }
Expand Down

0 comments on commit fce2bf4

Please sign in to comment.