README.md in superstore-1.2.0 vs README.md in superstore-2.0.0

- old
+ new

@@ -1,19 +1,17 @@ # Superstore -[![Build Status](https://secure.travis-ci.org/data-axle/superstore.png?rvm=2.0.0)](http://travis-ci.org/data-axle/superstore) [![Code Climate](https://codeclimate.com/github/data-axle/superstore.png)](https://codeclimate.com/github/data-axle/superstore) +[![Build Status](https://secure.travis-ci.org/data-axle/superstore.png?rvm=2.0.0)](http://travis-ci.org/data-axle/superstore) [![Code Climate](https://codeclimate.com/github/data-axle/superstore/badges/gpa.svg)](https://codeclimate.com/github/data-axle/superstore) -Cassandra Object uses ActiveModel to mimic much of the behavior in ActiveRecord. +Superstore uses ActiveModel to mimic much of the behavior in ActiveRecord. ## Installation -Add the following to your Gemfile: +Add the following to the `Gemfile`: ```ruby gem 'superstore' ``` -Change the version of Cassandra accordingly. Recent versions have not been backward compatible. - ## Defining Models ```ruby class Widget < Superstore::Base string :name @@ -28,55 +26,38 @@ end end ``` The table name defaults to the case-sensitive, pluralized name of the model class. To specify a -custom name, set the ```table_name``` attribute on the class: +custom name, set the `table_name` attribute on the class: ```ruby class MyWidget < Superstore::Base table_name = 'my_widgets' end ``` -## Using with Cassandra -Add the cassandra-cql gem to Gemfile: +## Using the PostgreSQL JSONB adapter -```ruby -gem 'cassandra-cql' -``` +Add the `pg` gem to the `Gemfile`: -Add a config/superstore.yml: - -```yaml -development: - adapter: cassandra - keyspace: my_app_development - servers: 127.0.0.1:9160 - thrift: - timeout: 20 - retries: 2 -``` - -## Using with Postgres HStore - -Add the pg gem to your Gemfile: - ```ruby gem 'pg' ``` -And a config/superstore.yml: +Add a `config/superstore.yml`: ```yaml development: - adapter: hstore + adapter: jsonb ``` +Superstore will share the existing ActiveRecord database connection. + ## Creating and updating records -Cassandra Object has equivalent methods as ActiveRecord: +Superstore has equivalent methods to ActiveRecord: ```ruby widget = Widget.new widget.valid? widget = Widget.create(name: 'Acme', price: 100) @@ -100,10 +81,11 @@ ``` ## Scoping Some lightweight scoping features are available: + ```ruby - Widget.where('color' => 'red') - Widget.select(['name', 'color']) - Widget.limit(10) +Widget.where('color' => 'red') +Widget.select(['name', 'color']) +Widget.limit(10) ```