Class: Neetob::CLI::MonthlyAudit::Databases::UsersUniqueEmailIndex
- Defined in:
- lib/neetob/cli/monthly_audit/databases/users_unique_email_index.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ UsersUniqueEmailIndex
constructor
A new instance of UsersUniqueEmailIndex.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize ⇒ UsersUniqueEmailIndex
Returns a new instance of UsersUniqueEmailIndex.
9 10 11 |
# File 'lib/neetob/cli/monthly_audit/databases/users_unique_email_index.rb', line 9 def initialize super() end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/neetob/cli/monthly_audit/databases/users_unique_email_index.rb', line 13 def run repo_data = [[ "Repository", "User table is indexed properly", "Comments", "Audit Passed" ] ] NeetoCompliance::NeetoRepos.products.keys.each do |repo| ui.info "Checking #{repo}...", print_to_audit_log: false code_audit_result = Neetob::CLI::Code::Audit.new([repo]).run[0] if code_audit_result[:error] repo_data << [repo, nil, code_audit_result[:error], "No"] next end unique_email_index_result = code_audit_result[:unique_email_index_result] if unique_email_index_result repo_data << [repo, "Yes", nil, "Yes"] else issue_url = GithubIssueCreation.new.create_issue( repo:, title: "Add unique index on users email", description: "Unique email index is not present for the users table") audit_passed = "No" + " #{issue_url}" repo_data << [repo, "No", "Unique email index is not present for the users table", audit_passed] end end ui.print_table(repo_data) end |