module Shrine::Plugins::ValidationHelpers
Documentation can be found on shrinerb.com/docs/plugins/validation_helpers
Constants
- DEFAULT_MESSAGES
- FILESIZE_UNITS
- PRETTY_FILESIZE
-
Returns filesize in a human readable format with units. Uses the binary JEDEC unit system, i.e. 1.0 KB = 1024 bytes
Public Class Methods
# File lib/shrine/plugins/validation_helpers.rb 39 def self.configure(uploader, default_messages: {}, **opts) 40 uploader.opts[:validation_helpers] ||= { default_messages: DEFAULT_MESSAGES.dup } 41 uploader.opts[:validation_helpers][:default_messages].merge!(default_messages) 42 end
# File lib/shrine/plugins/validation_helpers.rb 35 def self.load_dependencies(uploader, **) 36 uploader.plugin :validation 37 end