README.md in with_model-2.0.0 vs README.md in with_model-2.1.0
- old
+ new
@@ -1,14 +1,16 @@
# [with_model](https://github.com/Casecommons/with_model)
[![Gem Version](https://img.shields.io/gem/v/with_model.svg?style=flat)](https://rubygems.org/gems/with_model)
[![Build Status](https://secure.travis-ci.org/Casecommons/with_model.svg?branch=master)](https://travis-ci.org/Casecommons/with_model)
-[![Code Climate](https://img.shields.io/codeclimate/github/Casecommons/with_model.svg?style=flat)](https://codeclimate.com/github/Casecommons/with_model)
-[![Coverage Status](https://img.shields.io/coveralls/Casecommons/with_model/master.svg?style=flat)](https://coveralls.io/r/Casecommons/with_model)
`with_model` dynamically builds an ActiveRecord model (with table) before each test in a group and destroys it afterwards.
+## Development status
+
+`with_model` is actively maintained. It is quite stable, so while updates may appear infrequent, it is only because none are needed.
+
## Installation
Install as usual: `gem install with_model` or add `gem 'with_model'` to your Gemfile. See `.travis.yml` for supported (tested) Ruby versions.
### RSpec
@@ -41,28 +43,22 @@
```ruby
require 'spec_helper'
describe "A blog post" do
- before :all do
- module SomeModule; end
- end
+ module MyModule; end
- after :all do
- Object.send :remove_const, :SomeModule
- end
-
with_model :BlogPost do
- # The table block works just like a migration.
+ # The table block (and an options hash) is passed to ActiveRecord migration’s `create_table`.
table do |t|
t.string :title
t.timestamps null: false
end
- # The model block works just like the class definition.
+ # The model block is the ActiveRecord model’s class body.
model do
- include SomeModule
+ include MyModule
has_many :comments
validates_presence_of :title
def self.some_class_method
'chunky'
@@ -90,11 +86,11 @@
it "can be accessed as a constant" do
expect(BlogPost).to be
end
it "has the module" do
- expect(BlogPost.include?(SomeModule)).to eq true
+ expect(BlogPost.include?(MyModule)).to eq true
end
it "has the class method" do
expect(BlogPost.some_class_method).to eq 'chunky'
end
@@ -169,11 +165,11 @@
- RSpec or minitest/spec
- ActiveRecord 4.2+
## Versioning
-As of version 1.0.0, with_model uses [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html). Previous versions used an ad-hoc versioning scheme.
+`with_model` uses [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).
## License
-Copyright © 2010–2016 [Case Commons, Inc](http://casecommons.org).
+Copyright © 2010–2018 [Case Commons, Inc](http://casecommons.org).
Licensed under the MIT license, see [LICENSE](/LICENSE) file.