Code review: cleanup code
This commit is contained in:
parent
15ac9f3f45
commit
22c1eca61e
3 changed files with 4 additions and 5 deletions
|
@ -12,12 +12,11 @@ class Admin::GestionnairesController < AdminController
|
|||
|
||||
|
||||
def create
|
||||
gestionnaire_params = create_gestionnaire_params
|
||||
@gestionnaire = Gestionnaire.create(gestionnaire_params)
|
||||
@gestionnaire = Gestionnaire.create(create_gestionnaire_params)
|
||||
|
||||
if @gestionnaire.errors.messages.empty?
|
||||
flash.notice = 'Gestionnaire ajouté'
|
||||
GestionnaireMailer.new_gestionnaire(gestionnaire_params[:email], gestionnaire_params[:password]).deliver_now!
|
||||
GestionnaireMailer.new_gestionnaire(@gestionnaire.email, @gestionnaire.password).deliver_now!
|
||||
else
|
||||
flash.alert = @gestionnaire.errors.full_messages.join('<br />').html_safe
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ class Cerfa < ActiveRecord::Base
|
|||
belongs_to :dossier
|
||||
|
||||
mount_uploader :content, CerfaUploader
|
||||
validates :content, :file_size => { :maximum => 3.megabytes.to_i }
|
||||
validates :content, :file_size => { :maximum => 3.megabytes }
|
||||
|
||||
def empty?
|
||||
content.blank?
|
||||
|
|
|
@ -7,7 +7,7 @@ class PieceJustificative < ActiveRecord::Base
|
|||
alias_attribute :type, :type_de_piece_justificative_id
|
||||
|
||||
mount_uploader :content, PieceJustificativeUploader
|
||||
validates :content, :file_size => { :maximum => 3.megabytes.to_i }
|
||||
validates :content, :file_size => { :maximum => 3.megabytes }
|
||||
|
||||
def empty?
|
||||
content.blank?
|
||||
|
|
Loading…
Reference in a new issue