##A plugin to check activerecord connection with heartcheck.
Add this line to your application's Gemfile:
gem 'heartcheck-activerecord'
And then execute:
$ bundle
Or install it yourself as:
$ gem install heartcheck-activerecord
You can check any ActiveRecord connection that there's in your app.
Each service need to respond to :name
(an indetifier) and :connection
(an activerecord connection)
This service need be added with dynamic service;
Heartcheck.setup do |config|
config.add :activerecord do |c|
c.register_dynamic_services do
[{name: 'activerecord', connection: ActiveRecord::Base.connection}]
end
end
end
Check Heartcheck example here
You can use a CLI script in order to setup the project in your machine. Don't worry about ruby versions, or other project dependencies, you just need to have docker 19.03 or later installed.
Just run ./scripts/heartcheck help
in order to see the options available
- Fork it ( https://github.com/locaweb/heartcheck-activerecord/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request