From ef72d07a9e5bc804ad272bdd133f2b15efeed967 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 12 Apr 2016 14:18:07 +0200 Subject: [PATCH] [bug taiga#21] undefined method[] on notify_admin_profile_complete --- app/models/auth_provider.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/auth_provider.rb b/app/models/auth_provider.rb index c4b9655bf..a4fd39d00 100644 --- a/app/models/auth_provider.rb +++ b/app/models/auth_provider.rb @@ -5,6 +5,10 @@ class AuthProvider < ActiveRecord::Base def providable_type DatabaseProvider.name end + + def name + 'DatabaseProvider::SimpleAuthProvider' + end end PROVIDABLE_TYPES = %w(DatabaseProvider OAuth2Provider) @@ -39,6 +43,9 @@ class AuthProvider < ActiveRecord::Base ## Get the provider matching the omniAuth strategy name def self.from_strategy_name(strategy_name) + if strategy_name.blank? or all.empty? + return SimpleAuthProvider.new + end parsed = /^([^-]+)-(.+)$/.match(strategy_name) ret = nil all.each do |strategy|