README.md in superstore-2.4.4 vs README.md in superstore-2.5.0
- old
+ new
@@ -1,7 +1,7 @@
# Superstore
-[![Build Status](https://secure.travis-ci.org/data-axle/superstore.png?rvm=2.0.0)](http://travis-ci.org/data-axle/superstore)
+[![Build Status](https://travis-ci.org/data-axle/superstore.svg?branch=master)](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)
[![Gem](https://img.shields.io/gem/v/superstore.svg?maxAge=2592000)](https://rubygems.org/gems/superstore)
Superstore is a PostgreSQL JSONB document store which uses ActiveModel to mimic much of the behavior
in ActiveRecord.
@@ -13,31 +13,22 @@
## Installation
Add the following to the `Gemfile`:
```ruby
-gem 'pg'
gem 'superstore'
```
-Add a `config/superstore.yml`:
-
-```yaml
-development:
- adapter: jsonb
-```
-
Superstore will share the existing ActiveRecord database connection.
## Defining Models
```ruby
class Widget < Superstore::Base
- string :name
- string :description
- integer :price
- array :colors, unique: true
+ attribute :name, type: :string
+ attribute :price, type: :integer
+ attribute :colors, type: :array
validates :name, presence: :true
before_create do
self.description = "#{name} is the best product ever"
@@ -66,27 +57,6 @@
widget.update(price: 1200, name: 'Acme Corporation')
widget.attributes = {price: 300}
widget.price_was
widget.save
widget.save!
-```
-
-## Finding records
-
-```ruby
-widget = Widget.find(uuid)
-widget = Widget.first
-widgets = Widget.all
-Widget.find_each do |widget|
- # Codez
-end
-```
-
-## Scoping
-
-Some lightweight scoping features are available:
-
-```ruby
-Widget.where('color' => 'red')
-Widget.select(['name', 'color'])
-Widget.limit(10)
```