Allow blank for lien_demarche

This commit is contained in:
Mathieu Magnin 2017-01-31 15:13:06 +01:00
parent 1bd66b6a9e
commit 8ba8135e6b
4 changed files with 11 additions and 4 deletions

4
.byebug_history Normal file
View file

@ -0,0 +1,4 @@
exit
xit
xtei
cniuecniu

View file

@ -6,8 +6,11 @@ class Admin::PiecesJustificativesController < AdminController
end
def update
@procedure.update_attributes(update_params)
flash.now.notice = 'Modifications sauvegardées'
if @procedure.update_attributes(update_params)
flash.now.notice = 'Modifications sauvegardées'
else
flash.now.notice = 'Une erreur est survenue'
end
render 'show', format: :js
end

View file

@ -5,5 +5,5 @@ class TypeDePieceJustificative < ActiveRecord::Base
validates :libelle, presence: true, allow_blank: false, allow_nil: false
validates_format_of :lien_demarche, with: URI::regexp
validates :lien_demarche, format: { with: URI::regexp }, allow_blank: true, allow_nil: true
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170118144306) do
ActiveRecord::Schema.define(version: 20170125152856) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"