--
You received this message because you are subscribed to the Google Groups "Shrine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine+unsubscribe@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/ed484ef8-d2e8-43a2-9f3c-d6402622721c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
`<main>': undefined method `attacher_methods' for Shrine:Class (NoMethodError)
require 'shrine'
require 'shrine/storage/file_system'
require 'image_processing/mini_magick'
# Custom plugin
class Shrine
module Plugins
module ImageSizeForRails
module FileMethods
def to_size
# Converts image dimensions array into :size param
# so it can be used by the standard Rails image_tag helper
# [1024,768] => "1024x768"
dimensions.join("x")
end
end
end
register_plugin(:image_size_for_rails, ImageSizeForRails)
end
end
Shrine.storages = {
cache: Shrine::Storage::FileSystem.new("tmp", prefix: "cache/uploads"), # temporary storage
store: Shrine::Storage::FileSystem.new("public", prefix: "uploads"), # permanent storage
}
Shrine.plugin :activerecord
Shrine.plugin :backgrounding
Shrine.plugin :image_size_for_rails
Shrine.plugin :module_include
Shrine::Attacher.promote { |data| UploadJob.perform_later(data) }
Shrine::Attacher.delete { |data| DeleteJob.perform_later(data) }
Shrine.attacher_methods do
def recache
super
delete!(@old) if cached?
end
endTo unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine+unsubscribe@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/e40a500a-7181-4268-ac49-ae2fd2871df6%40googlegroups.com.
undefined method `delete' for nil:NilClass
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine+unsubscribe@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/1b84116e-a31e-4206-92dc-2be39fb126a9%40googlegroups.com.