Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/brakeman.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
{
"warning_type": "SQL Injection",
"warning_code": 0,
"fingerprint": "05636d40d833157e028a2fd9aecd6f263d7f3915f8ed3334a502e18763f1841d",
"fingerprint": "b9be381566d68ef14f46a175c99ec4814565753eb616f259e5ddcdd9aff5f819",
"check_name": "SQL",
"message": "Possible SQL injection",
"file": "lib/autorequire/data_import.rb",
"line": 148,
"link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
"code": "ActiveRecord::Base.connection.execute(\"SELECT setval('topics_id_seq', #{((Topic.maximum(:id) or 0) + 1)}, ?)\", false)",
"code": "ActiveRecord::Base.connection.execute(\"SELECT setval('topics_id_seq', #{((Topic.maximum(:id) or 0) + 1)}, false)\")",
"render_path": null,
"location": {
"type": "method",
Expand All @@ -24,5 +24,5 @@
"note": ""
}
],
"brakeman_version": "7.0.2"
"brakeman_version": "7.1.0"
}
2 changes: 1 addition & 1 deletion lib/autorequire/data_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def self.import_topics
def self.reset_topic_id_starting_value
max_id = Topic.maximum(:id) || 0
new_start_value = max_id + 1
ActiveRecord::Base.connection.execute("SELECT setval('topics_id_seq', #{new_start_value}, ?)", false)
ActiveRecord::Base.connection.execute("SELECT setval('topics_id_seq', #{new_start_value}, false)")
puts "Reset topics ID starting value to #{new_start_value}"
end

Expand Down