Sha256: cca2b56591854086c110774d9ffedca235a95726c148eeb531637eb82347189f
Contents?: true
Size: 558 Bytes
Versions: 14
Compression:
Stored size: 558 Bytes
Contents
class Shrine module Plugins module CortexValidationHelpers module AttacherMethods def validations context[:config][:validations] end def validate?(validation) validations.key? validation end def allowed_content_types validations[:allowed_extensions].collect do |allowed_content_type| MimeMagic.by_extension(allowed_content_type).type end end end end register_plugin(:cortex_validation_helpers, CortexValidationHelpers) end end
Version data entries
14 entries across 14 versions & 1 rubygems