Module: Shrine::Plugins::RemoveAttachment::AttachmentMethods

Defined in:
lib/shrine/plugins/remove_attachment.rb

Instance Method Summary collapse

Instance Method Details

#define_model_methods(name) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
# File 'lib/shrine/plugins/remove_attachment.rb', line 8

def define_model_methods(name)
  super if defined?(super)

  define_method :"remove_#{name}=" do |value|
    send(:"#{name}_attacher").remove = value
  end

  define_method :"remove_#{name}" do
    send(:"#{name}_attacher").remove
  end
end