binnacle_ar
Active Record CUD (Create-Update-Delete) interceptor for Binnacle
__/\\\______________________________________________________________________________/\\\\\\____________________ _\/\\\_____________________________________________________________________________\////\\\____________________ _\/\\\__________/\\\__________________________________________________________________\/\\\____________________ _\/\\\_________\///____/\\/\\\\\\_____/\\/\\\\\\_____/\\\\\\\\\_________/\\\\\\\\_____\/\\\_________/\\\\\\\\__ _\/\\\\\\\\\____/\\\__\/\\\////\\\___\/\\\////\\\___\////////\\\______/\\\//////______\/\\\_______/\\\/////\\\_ _\/\\\////\\\__\/\\\__\/\\\__\//\\\__\/\\\__\//\\\____/\\\\\\\\\\____/\\\_____________\/\\\______/\\\\\\\\\\\__ _\/\\\__\/\\\__\/\\\__\/\\\___\/\\\__\/\\\___\/\\\___/\\\/////\\\___\//\\\____________\/\\\_____\//\\///////___ _\/\\\\\\\\\___\/\\\__\/\\\___\/\\\__\/\\\___\/\\\__\//\\\\\\\\/\\___\///\\\\\\\\___/\\\\\\\\\___\//\\\\\\\\\\_ _\/////////____\///___\///____\///___\///____\///____\////////\//______\////////___\/////////_____\//////////__
Overview
Adds ActiveRecord callbacks for create, update and delete that will signal Binnacle with the state of the object (to_json)
Setup
Add the binnacle_ar gem to your Gemfile:
gem 'binnacle_ar'
Configure Binnacle Ruby driver by providing the values for endpoint, target context and a valid publisher’s api key and secret:
BINNACLE_ENDPOINT=localhost
BINNACLE_AR_CTX=26e5z3cybiv5tqj12zy6
BINNACLE_API_KEY=nmp9wnfoj1t10spzi57r
BINNACLE_API_SECRET=xsh3lanzk4oaqxcvho7d
Usage
Use the binnacle_signal
class method on an ActiveRecord model to decide on
which actions to signal Binnacle:
class Comment < ActiveRecord::Base
binnacle_signal :on => [:create, :update, :destroy]
end