Commit e424fdc0783f9f781286d8921bae92a0ecc287c9

Authored by Daniel
Committed by Rafael Manzo
1 parent aa2fd69e

[Colab] Fix password validation for User with OmniAuth provider

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/models/user.rb
@@ -10,7 +10,7 @@ class User < ActiveRecord::Base @@ -10,7 +10,7 @@ class User < ActiveRecord::Base
10 validates :provider, presence: true, unless: Proc.new { |user| user.uid.nil? || user.uid.blank? } 10 validates :provider, presence: true, unless: Proc.new { |user| user.uid.nil? || user.uid.blank? }
11 validates :uid, presence: true, uniqueness: { scope: :provider }, 11 validates :uid, presence: true, uniqueness: { scope: :provider },
12 unless: Proc.new { |user| user.provider.nil? || user.provider.blank? } 12 unless: Proc.new { |user| user.provider.nil? || user.provider.blank? }
13 - 13 +
14 has_many :project_attributes, class_name: 'ProjectAttributes' 14 has_many :project_attributes, class_name: 'ProjectAttributes'
15 has_many :reading_group_attributes, class_name: 'ReadingGroupAttributes' 15 has_many :reading_group_attributes, class_name: 'ReadingGroupAttributes'
16 has_many :repository_attributes, class_name: 'RepositoryAttributes' 16 has_many :repository_attributes, class_name: 'RepositoryAttributes'
@@ -24,6 +24,6 @@ class User < ActiveRecord::Base @@ -24,6 +24,6 @@ class User < ActiveRecord::Base
24 protected 24 protected
25 25
26 def password_required? 26 def password_required?
27 - provider.nil? 27 + provider.nil? && super
28 end 28 end
29 end 29 end