Set maximum number of documents on proposal and budget investments. Show alert on documents tab when maximum reached. Hide upload button when maximum reached.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-21 18:44:33 +02:00
parent 462931845b
commit 6b61cbe35c
10 changed files with 46 additions and 6 deletions

View File

@@ -1,6 +1,5 @@
class Budget
class Investment < ActiveRecord::Base
include Measurable
include Sanitizable
include Taggable
@@ -13,6 +12,8 @@ class Budget
acts_as_paranoid column: :hidden_at
include ActsAsParanoidAliases
MAX_DOCUMENTS_SIZE = 3
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
belongs_to :heading
belongs_to :group