Hello everyone ,
I am trying to find a way to use Shrine with a structure that wouldnt be linked to an Active Record model.
Column is good in serializing/deserializing. But I am now trying to use Entity in order to have an abstraction of the “image”.
I have created a special folder in my Rails app called “structures” and added this code :
class MyPhoto < Entity(:image_data) include MyUploader::Attachment(:image) end
Shrine initializer does show
Shrine.plugin :entity and MyUploader (names have been abstracted) has the following :
require "image_processing/vips" require "image_processing/mini_magick" class MyUploader < Shrine plugin :validation_helpers # to validate image data plugin :add_metadata plugin :store_dimensions plugin :derivatives plugin :default_storage, cache: :transfer_cache, store: :transfer_store etc ..
When I am creating a new entity instance
MyPhoto.new I get error
<main>': undefined method Entity’ for main:Object (NoMethodError)
I am not sure if I am usig Entity properly and was wondering if someone would have a Gist or thread about Entity ?
Thanks a lot