Adds a user controller for management
This commit is contained in:
@@ -35,6 +35,8 @@ class User < ActiveRecord::Base
|
||||
|
||||
accepts_nested_attributes_for :organization, update_only: true
|
||||
|
||||
attr_accessor :skip_password_validation
|
||||
|
||||
scope :administrators, -> { joins(:administrators) }
|
||||
scope :moderators, -> { joins(:moderator) }
|
||||
scope :organizations, -> { joins(:organization) }
|
||||
@@ -162,6 +164,11 @@ class User < ActiveRecord::Base
|
||||
sign_in_count == 1 && unverified? && !organization && !administrator?
|
||||
end
|
||||
|
||||
def password_required?
|
||||
return false if skip_password_validation
|
||||
super
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def validate_username_length
|
||||
|
||||
Reference in New Issue
Block a user