https://github.com/slashdotdash/rcqrs-rails
Rails 3 plugin to use the RCQRS library
https://github.com/slashdotdash/rcqrs-rails
Last synced: 9 months ago
JSON representation
Rails 3 plugin to use the RCQRS library
- Host: GitHub
- URL: https://github.com/slashdotdash/rcqrs-rails
- Owner: slashdotdash
- License: mit
- Created: 2010-09-22T20:13:17.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-02-22T16:27:55.000Z (over 15 years ago)
- Last Synced: 2025-04-02T23:08:10.874Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 490 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RCQRS Rails 3 Plugin
Use the [RCQRS](https://github.com/slashdotdash/rcqrs) library in your Rails 3 web app.
## Usage
Add the following dependencies to your Rails app's Gemfile and then `sudo bundle install`
gem "uuidtools"
gem "yajl-ruby", :require => 'yajl'
gem "eventful"
gem "rcqrs"
gem "rcqrs-rails"
Add the following snippet inside `application_controller.rb` (ensuring it is `protected`) to allow each of your controllers to publish commands.
def publish(command)
Rcqrs::Gateway.publish(command)
end
Create a yaml config file with your event storage configuration named `config/event_storage.yml` (or copy the example in `example/event_storage.yml`).
##Generators
This plugin provides three generators to ease common tasks for generating commands, events and controllers using the CQRS pattern.
* rcqrs:command
* rcqrs:controller
* rcqrs:event
Usage is `rails generate rcqrs:command `