mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 10:19:45 +02:00
Merge branch '113524121-legal_doc_min_size' into staging
This commit is contained in:
commit
74b3b5d5a3
2 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ $(document).on 'page:change', ->
|
||||||
$('.js-contact-form').trigger('restoreDefault')
|
$('.js-contact-form').trigger('restoreDefault')
|
||||||
|
|
||||||
$('[data-legal-document]').each (i, fileInput)->
|
$('[data-legal-document]').each (i, fileInput)->
|
||||||
minSize = 1 * 1024 # 100kB
|
minSize = 8 * 1024 # 8kB
|
||||||
maxSize = 8 * 1024 * 1024; # 8 MB
|
maxSize = 8 * 1024 * 1024; # 8 MB
|
||||||
$(fileInput).closest('form').submit (e) ->
|
$(fileInput).closest('form').submit (e) ->
|
||||||
if (files = fileInput.files).length
|
if (files = fileInput.files).length
|
||||||
|
|
|
@ -10,7 +10,7 @@ class LegalDocument < ActiveRecord::Base
|
||||||
belongs_to :documentable, polymorphic: true
|
belongs_to :documentable, polymorphic: true
|
||||||
|
|
||||||
|
|
||||||
validates :body, length: { minimum: (1.37 * 1.4).ceil }, unless: :path
|
validates :body, length: { minimum: (1.37 * 8.kilobytes).ceil }, unless: :path
|
||||||
|
|
||||||
before_create :add_creator
|
before_create :add_creator
|
||||||
before_save :save_to_filesystem, if: :body
|
before_save :save_to_filesystem, if: :body
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue