Skip to content

Commit

Permalink
Merge pull request #159 from letiesperon/chore/fix-active-storage-loa…
Browse files Browse the repository at this point in the history
…der-example

Fix ActiveStorageLoader example
  • Loading branch information
swalkinshaw authored Apr 11, 2023
2 parents 57e7150 + 4a89a9d commit e476f7c
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 e476f7c

Please sign in to comment.