Skip to content

Commit

Permalink
chore: potential refactor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brwali committed Oct 27, 2024
1 parent 2ea8f4b commit 1b7e152
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def self.export(csv, parent_id, options, teamtype)
if options[:team_name] == 'false'
team_members = TeamsUser.where(team_id: team.id)
team_members.each do |user|
user_export = user.respond_to?(:username) ? user.username : user.user
user_export = user.is_a?(User) ? user.username : user.user
output.push(user_export)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class User < ApplicationRecord
belongs_to :parent, class_name: 'User'
belongs_to :role
validates :username, presence: true
validates_uniqueness_of :username, :case_sensitive => true
validates_uniqueness_of :username
validates :username, format: { without: /\s/ }

validates :email, presence: { message: "can't be blank" }
Expand Down

0 comments on commit 1b7e152

Please sign in to comment.