Merge branch 'staging'

This commit is contained in:
Xavier J 2016-12-13 14:24:46 +01:00
commit 26ac6d5cc4
3 changed files with 23 additions and 3 deletions

View file

@ -6,8 +6,10 @@ class InvitesController < ApplicationController
class_var = @current_devise_profil.class == User ? InviteUser : InviteGestionnaire class_var = @current_devise_profil.class == User ? InviteUser : InviteGestionnaire
user = User.find_by_email(params[:email]) email = params[:email].downcase
invite = class_var.create(dossier_id: params[:dossier_id], user: user, email: params[:email].downcase, email_sender: email_sender)
user = User.find_by_email(email)
invite = class_var.create(dossier_id: params[:dossier_id], user: user, email: email, email_sender: email_sender)
if invite.valid? if invite.valid?
InviteMailer.invite_user(invite).deliver_now! unless invite.user.nil? InviteMailer.invite_user(invite).deliver_now! unless invite.user.nil?

View file

@ -0,0 +1,11 @@
class CreateTablePreferenceDeviseProfil < ActiveRecord::Migration
def change
create_table :preference_devise_profils do |t|
t.string :last_current_devise_profil
end
add_belongs_to :preference_devise_profils, :administrateurs
add_belongs_to :preference_devise_profils, :gestionnaires
add_belongs_to :preference_devise_profils, :users
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161115053251) do ActiveRecord::Schema.define(version: 20161205110427) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -279,6 +279,13 @@ ActiveRecord::Schema.define(version: 20161115053251) do
add_index "pieces_justificatives", ["dossier_id"], name: "index_pieces_justificatives_on_dossier_id", using: :btree add_index "pieces_justificatives", ["dossier_id"], name: "index_pieces_justificatives_on_dossier_id", using: :btree
add_index "pieces_justificatives", ["type_de_piece_justificative_id"], name: "index_pieces_justificatives_on_type_de_piece_justificative_id", using: :btree add_index "pieces_justificatives", ["type_de_piece_justificative_id"], name: "index_pieces_justificatives_on_type_de_piece_justificative_id", using: :btree
create_table "preference_devise_profils", force: :cascade do |t|
t.string "last_current_devise_profil"
t.integer "administrateurs_id"
t.integer "gestionnaires_id"
t.integer "users_id"
end
create_table "preference_list_dossiers", force: :cascade do |t| create_table "preference_list_dossiers", force: :cascade do |t|
t.string "libelle" t.string "libelle"
t.string "table" t.string "table"