module Shrine::Plugins::Included

  1. lib/shrine/plugins/included.rb

The included plugin allows you to hook up to the .included hook of the attachment module, and call additional methods on the model which includes it.

plugin :included do |name|
  before_save do
    # ...
  end
end

If you want to define additional methods on the model, it's recommended to use the module_include plugin instead.

Methods

Public Class

  1. configure

Public Class methods

configure (uploader, &block)
[show source]
# File lib/shrine/plugins/included.rb, line 16
def self.configure(uploader, &block)
  uploader.opts[:included_block] = block
end