orientea: command pattern for active record.

========

This is one command pattern implementation for ruby. Designed to use with rails (ActiveRecord).

Current support Rails 4. You can store the command object , perform it by action method , or undo it by undo method. Useful for auditing and undo users’ modification on model.########

Note: this gem use postgresql with hstore extension.

INSTALL:

  # add gem to gemfile
  gem 'orientea' 

  # run command to setup database table
  rails generate orientea:command  # to create the migration file for command table
  rake db:migrate

USAGE:

@record = Record.new
  reate_command = Orientea::CreatingCommand.build(@record)  # would build and save the command
  record.name = "changed name"
  hange_command = Orientea::ChangingCommand.build(@record)
  hange_command.your_any_customized_attributes = .....
  hange_command.save # will save the command object
  hange_command.action # would apply the changes
  hange_command.undo # would discard the changes

== Contributing to orientea

== Copyright

Copyright © 2013 Vincent Zhu. See LICENSE.txt for further details.

One Command Pattern Implementation For Ruby with ActiveRecord