REFACTOR : remove column 'montant_projet', 'montant_aide_demande', 'date_previsionnelle', 'position_lat', 'position_lon' et 'ref_dossier_cart' of dossier table

This commit is contained in:
Xavier J 2015-11-02 18:56:41 +01:00
parent 8db705ec94
commit 2050465a75
15 changed files with 87 additions and 240 deletions

View file

@ -12,13 +12,13 @@ class Users::CarteController < UsersController
dossier = current_user_dossier
if dossier.draft?
dossier.update_attributes(ref_dossier_carto: params[:ref_dossier])
#dossier.update_attributes(ref_dossier_carto: params[:ref_dossier])
redirect_to url_for(controller: :description, action: :show, dossier_id: params[:dossier_id])
else
commentaire_params = {
email: 'Modification localisation',
body: 'La localisation de la demande a été modifiée. Merci de le prendre en compte.',
dossier_id: dossier.id
email: 'Modification localisation',
body: 'La localisation de la demande a été modifiée. Merci de le prendre en compte.',
dossier_id: dossier.id
}
commentaire = Commentaire.new commentaire_params
commentaire.save
@ -28,18 +28,12 @@ class Users::CarteController < UsersController
end
def get_position
dossier = current_user_dossier
tmp_position = Carto::Geocodeur.convert_adresse_to_point(current_user_dossier.etablissement.adresse.gsub("\r\n", ' '))
if dossier.position_lat.nil?
tmp_position = Carto::Geocodeur.convert_adresse_to_point(dossier.etablissement.adresse.gsub("\r\n", ' '))
if tmp_position.point.nil?
dossier.update_attributes(position_lat: '0', position_lon: '0')
else
dossier.update_attributes(position_lat: tmp_position.point.y, position_lon: tmp_position.point.x)
end
if !tmp_position.point.nil?
render json: {lon: tmp_position.point.x.to_s, lat: tmp_position.point.y.to_s, dossier_id: params[:dossier_id]}
else
render json: {lon: '0', lat: '0', dossier_id: params[:dossier_id]}
end
render json: { lon: dossier.position_lon, lat: dossier.position_lat, dossier_id: params[:dossier_id] }
end
end

View file

@ -56,6 +56,6 @@ class Users::DescriptionController < UsersController
private
def create_params
params.permit(:nom_projet, :description, :montant_projet, :montant_aide_demande, :date_previsionnelle)
params.permit(:nom_projet, :description)
end
end