diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e9a7ae9..73c35670c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.1 (unreleased) + +- Fixed error with Rails 7.1 when no user model + ## 3.0.0 (2023-09-20) - Switched from Mapbox.js to Mapbox GL JS v1 for maps (this affects Mapbox billing) diff --git a/lib/blazer/run_statement.rb b/lib/blazer/run_statement.rb index f0cf6c739..40eba3bab 100644 --- a/lib/blazer/run_statement.rb +++ b/lib/blazer/run_statement.rb @@ -13,7 +13,8 @@ def perform(statement, options = {}) audit = Blazer::Audit.new(statement: audit_statement) audit.query = query audit.data_source = data_source.id - audit.user = options[:user] + # only set user if present to avoid error with Rails 7.1 when no user model + audit.user = options[:user] unless options[:user].nil? audit.save! end