Skip to content

Commit

Permalink
Merge pull request #327 from mssola/mysql-fix
Browse files Browse the repository at this point in the history
active_record: fix for MySQL on connection error
  • Loading branch information
pokonski authored Dec 20, 2018
2 parents 16ba5fd + 665643d commit 0a521d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/public_activity/orm/active_record/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Activity < ::ActiveRecord::Base
end
rescue ::ActiveRecord::NoDatabaseError => e
warn("[WARN] database doesn't exist. Skipping PublicActivity::Activity#parameters's serialization")
rescue Mysql2::Error::ConnectionError
warn("[WARN] database is not available. Skipping PublicActivity::Activity#parameters's serialization")
end

if ::ActiveRecord::VERSION::MAJOR < 4 || defined?(ProtectedAttributes)
Expand Down

0 comments on commit 0a521d4

Please sign in to comment.