module Shrine::Plugins::Model::AttachmentMethods
Public Class Methods
Source
# File lib/shrine/plugins/model.rb 21 def initialize(name, model: true, **) 22 super(name, **) 23 @model = model 24 end
Allows disabling model behaviour:
Shrine::Attachment(:image) # model (default) Shrine::Attachment(:image, model: false) # entity
Calls superclass method
Public Instance Methods
Source
# File lib/shrine/plugins/model.rb 29 def included(klass) 30 super 31 define_model_methods(@name) if model? 32 end
We define model methods only on inclusion. This gives other plugins the ability to disable model behaviour for entity classes. In this case we want to skip defining model methods as well.
Calls superclass method