README.md in draper-3.1.0 vs README.md in draper-4.0.0

- old
+ new

@@ -1,9 +1,10 @@ # Draper: View Models for Rails [![TravisCI Build Status](https://travis-ci.org/drapergem/draper.svg?branch=master)](http://travis-ci.org/drapergem/draper) [![Code Climate](https://codeclimate.com/github/drapergem/draper.svg)](https://codeclimate.com/github/drapergem/draper) +[![Test Coverage](https://api.codeclimate.com/v1/badges/0d40c43951d516bf6985/test_coverage)](https://codeclimate.com/github/drapergem/draper/test_coverage) [![Inline docs](http://inch-ci.org/github/drapergem/draper.svg?branch=master)](http://inch-ci.org/github/drapergem/draper) Draper adds an object-oriented layer of presentation logic to your Rails application. @@ -105,11 +106,11 @@ * mark up attributes with a little semantic HTML, like turning a `url` field into a hyperlink ## Installation -As of version 3.0.0, Draper is only compatible with Rails 5 / Ruby 2.2 and later. Add Draper to your Gemfile. +As of version 4.0.0, Draper only officially supports Rails 5.2 / Ruby 2.4 and later. Add Draper to your Gemfile. ```ruby gem 'draper' ``` @@ -377,11 +378,11 @@ you'll have access to an ArticleDecorator object instead. In your controller you can continue to use the `@article` instance variable to manipulate the model - for example, `@article.comments.build` to add a new blank comment for a form. ## Configuration -Draper works out the box well, but also provides a hook for you to configure its +Draper works out the box well, but also provides a hook for you to configure its default functionality. For example, Draper assumes you have a base `ApplicationController`. If your base controller is named something different (e.g. `BaseController`), you can tell Draper to use it by adding the following to an initializer: ```ruby @@ -466,14 +467,17 @@ include Draper::ViewHelpers end ``` Then you can stub the specific route helper functions you need using your -preferred stubbing technique (this example uses RSpec's `stub` method): +preferred stubbing technique. This examples uses Rspec currently recommended API +available in RSpec 3.6+ ```ruby -helpers.stub(users_path: '/users') +without_partial_double_verification do + allow(helpers).to receive(:users_path).and_return('/users') +end ``` ### View context leakage As mentioned before, Draper needs to build a view context to access helper methods. In MiniTest, the view context is cleared during `before_setup` preventing any view context leakage. In RSpec, the view context is cleared before each @@ -643,10 +647,10 @@ you're using another ORM, or want to decorate plain old Ruby objects, you can include this module manually. ### Active Job Integration -[Active Job](http://edgeguides.rubyonrails.org/active_job_basics.html) allows you to pass ActiveRecord +[Active Job](http://edgeguides.rubyonrails.org/active_job_basics.html) allows you to pass ActiveRecord objects to background tasks directly and performs the necessary serialization and deserialization. In order to do this, arguments to a background job must implement [Global ID](https://github.com/rails/globalid). Decorated objects implement Global ID by delegating to the object they are decorating. This means you can pass decorated objects to background jobs, however, the object won't be decorated when it is deserialized.