Skip to content

Commit

Permalink
Fix ActiveStorageLoader example
Browse files Browse the repository at this point in the history
  • Loading branch information
letiesperon committed Apr 10, 2023
1 parent 57e7150 commit 4a89a9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/active_storage_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# end

####
# An example data type using the AttachmentLoader
# An example data type using the Loaders::ActiveStorageLoader
####

# class Types::EventType < Types::BaseObject
Expand All @@ -25,15 +25,15 @@
# field :pictures, String, null: true
#
# def image
# AttachmentLoader.for(:Event, :image).load(object.id).then do |image|
# Loaders::ActiveStorageLoader.for(:Event, :image).load(object.id).then do |image|
# Rails.application.routes.url_helpers.url_for(
# image.variant({ quality: 75 })
# )
# end
# end
#
# def pictures
# AttachmentLoader.for(:Event, :pictures, association_type: :has_many_attached).load(object.id).then do |pictures|
# Loaders::ActiveStorageLoader.for(:Event, :pictures, association_type: :has_many_attached).load(object.id).then do |pictures|
# pictures.map do |picture|
# Rails.application.routes.url_helpers.url_for(
# picture.variant({ quality: 75 })
Expand Down

0 comments on commit 4a89a9d

Please sign in to comment.