users can create spending proposals
This commit is contained in:
@@ -3,14 +3,16 @@ class SpendingProposal < ActiveRecord::Base
|
||||
include Sanitizable
|
||||
include Taggable
|
||||
|
||||
apply_simple_captcha
|
||||
|
||||
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
|
||||
|
||||
validates :title, presence: true
|
||||
validates :author, presence: true
|
||||
validates :description, presence: true
|
||||
|
||||
validates :title, length: { in: 4..Proposal.title_max_length }
|
||||
validates :description, length: { maximum: Proposal.description_max_length }
|
||||
validates :title, length: { in: 4..SpendingProposal.title_max_length }
|
||||
validates :description, length: { maximum: SpendingProposal.description_max_length }
|
||||
|
||||
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user