FIX: error during signup saying "Password is the same as your current password" due to automatic group membership granting a trust level

This commit is contained in:
Neil Lalonde
2016-12-28 17:36:02 -05:00
parent 67347432b7
commit 9c40657ba4
3 changed files with 33 additions and 3 deletions

View File

@@ -370,6 +370,11 @@ class Group < ActiveRecord::Base
self.where("string_to_array(incoming_email, '|') @> ARRAY[?]", Email.downcase(email)).first
end
def self.grants_by_email_domain
Group.where(automatic: false)
.where("LENGTH(COALESCE(automatic_membership_email_domains, '')) > 0")
end
def bulk_add(user_ids)
if user_ids.present?
Group.exec_sql("INSERT INTO group_users