Pushable::Rails
Send model updates to Pusher
Installation
Add this line to your application's Gemfile:
gem 'pushable-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pushable-rails
Usage
Include the Pushable module in your activerecord models like this:
class DummyModel < ActiveRecord::Base
include Pushable
end
Now every time you create, update or destroy DummyModels your app will send the corresponding notifications to pusher.
Channel: pusher
Events:
Create 'dummy_model.destroy'
Update 'dummy_model.update'
Destroy 'dummy_model.destroy'
The payload will be the output of the model instance to_json. If defined, a serializer will be used (eg. DummyModelSerializer).
Contributing
- Fork it ( http://github.com/
/pushable-rails/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 new Pull Request