Prevent responsible_name and question from validation
This commit is contained in:
@@ -49,9 +49,10 @@ class Legislation::ProposalsController < Legislation::BaseController
|
||||
private
|
||||
|
||||
def proposal_params
|
||||
params.require(:legislation_proposal).permit(:legislation_process_id, :title, :question, :summary, :description, :external_url, :video_url,
|
||||
:responsible_name, :tag_list, :terms_of_service, :geozone_id,
|
||||
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id] )
|
||||
params.require(:legislation_proposal).permit(:legislation_process_id, :title,
|
||||
:question, :summary, :description, :video_url, :tag_list,
|
||||
:terms_of_service, :geozone_id,
|
||||
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id] )
|
||||
end
|
||||
|
||||
def resource_model
|
||||
|
||||
@@ -25,15 +25,11 @@ class Legislation::Proposal < ActiveRecord::Base
|
||||
has_many :comments, as: :commentable
|
||||
|
||||
validates :title, presence: true
|
||||
validates :question, presence: true
|
||||
validates :summary, presence: true
|
||||
validates :author, presence: true
|
||||
validates :responsible_name, presence: true
|
||||
|
||||
validates :title, length: { in: 4..Legislation::Proposal.title_max_length }
|
||||
validates :description, length: { maximum: Legislation::Proposal.description_max_length }
|
||||
validates :question, length: { in: 10..Legislation::Proposal.question_max_length }
|
||||
validates :responsible_name, length: { in: 6..Legislation::Proposal.responsible_name_max_length }
|
||||
|
||||
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
|
||||
|
||||
|
||||
Reference in New Issue
Block a user