Module: Shrine::Plugins::Sequel

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

Overview

Documentation can be found on shrinerb.com/docs/plugins/sequel

Defined Under Namespace

Modules: AttacherMethods, AttachmentMethods

Class Method Summary collapse

Class Method Details

.configure(uploader, **opts) ⇒ Object


14
15
16
17
18
19
20
21
22
# File 'lib/shrine/plugins/sequel.rb', line 14

def self.configure(uploader, **opts)
  if opts.key?(:callbacks)
    Shrine.deprecation("The :callbacks option in sequel plugin has been renamed to :hooks. The :callbacks alias will be removed in Shrine 4.")
    opts[:hooks] = opts.delete(:callbacks)
  end

  uploader.opts[:sequel] ||= { hooks: true, validations: true }
  uploader.opts[:sequel].merge!(opts)
end

.load_dependencies(uploader) ⇒ Object


9
10
11
12
# File 'lib/shrine/plugins/sequel.rb', line 9

def self.load_dependencies(uploader, **)
  uploader.plugin :model
  uploader.plugin :_persistence, plugin: self
end