Module: Shrine::Plugins::Activerecord

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

Overview

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

Defined Under Namespace

Modules: AttacherMethods, AttachmentMethods

Class Method Summary collapse

Class Method Details

.configure(uploader, **opts) ⇒ Object


14
15
16
17
# File 'lib/shrine/plugins/activerecord.rb', line 14

def self.configure(uploader, **opts)
  uploader.opts[:activerecord] ||= { callbacks: true, validations: true }
  uploader.opts[:activerecord].merge!(opts)
end

.load_dependencies(uploader) ⇒ Object


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

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