Roar 1.1 (and Representable 3.0) support (see Roar CHANGES)
- Require Roar >= 1.1.0.
- Improved support for JSON API (now requires separate roar-jsonapi gem).
- Fix Uber version requirement.
- Make Roar version requirement stricter: restrict to 1.0.x series.
- Initial support for Rails 5.
- Added a dependency on
responders
gem for Rails 4.2 support #render
fromControllerAdditions::Render
now accepts a status code- Added support for JSON-API.
- Requires Roar >= 1.0.0.
- In
#consume!
roar-rails now finds the correct representer for theContent-type:
header. In former version the representer name was inferred using theAccept:
header, which was totally wrong. Thanks to @pgaertig for fixing that.
- Added
ControllerAdditions::Render
to support#render
in controller actions with representers. - Roar-rails now works properly with rails-api.
Roar::Rails::Responder
is a class now.- Moved
RepresenterComputer
toFormats
.
- Maintenance release, using Uber now and get rid of deprecation warning.
- Added a generator to create modules from the command-line. Thanks to Guilherme Cavalcanti for working on this.
- We always use
request.body.read
now, however, we callrewind
beforehand.
- Fix a bug where
TestCase
wouldn't work in 3.2.
- Introducing a check where
request.body.read
is called (as usual) ifrequest.body.string
isn't present. This is due to some faulty behaviour in Rails and some web servers that don't provide a properly working#read
, as it's the Rack rule. Should finally fix trailblazer#18 and friends. TestCase#process
no longer triggers a deprecation warning for Rails > 3.1.- Now allows using roar >= 0.11.
- Added the
represented_formats: [...]
option to be passed to#respond_with
for either suppressing roar-rails from extending/decorating models when rendering or to fine-tune so this will only happen on white-listed formats as:hal
. This can also be set globally usingconfig.representer.represented_formats
.
ActiveRecord::Relation
is now detected as a collection and the appropriate representer should be found.- Entity (singular) representers are now correctly inferred even if you only specified
collection:
in::represents
. That works by querying the model. - Entity representers are now namespaced when guessed (i.e., when you didn't specify them explicitly in
::represents
) as it works with collection representers already. If you have a namespaced controller and it suddenly doesn't find its entity representer anymore, either namespace the representer or specify its name in::represents
.
- Moved logic to infer representer names from
ControllerAdditions
toRepresenterComputer
class. - Representer names passed to
::represents
are now constantized at runtime where they are actually needed, only. This fixes a bug where you were required to provide aSingersRepresenter
(for collections) everywhere even when you just want to represent singular resources. - You can now pass strings to
::represents
as representer names.
- Allow passing user options to both
#respond_with
and#consume!
. - Fixing
#consume!
with decorators.
- Bumping representable to 1.4 which allows us using both extend and decorating representers.
- Back to
request.body.read
in#consume!
(again). If anyone is having problems with empty incoming strings this is a Rails issue - update ;-)
- Empty resources now work properly in Rails 3.0 and 3.1.
- Changed
request.body.string
toread
to make it work with Unicorn.
- Added
#represents
to configure consuming and rendering on controller class layer. This also callsrespond_to
.
- Introduce
:represent_with
and:represent_items_with
for#respond_with
. In turn, deprecate the old behaviour since it will change in 1.0.
- Make roar-rails rely on roar 0.10 and bigger.
- Added
#consume!
to infer representer name and parse the incoming document for a model.
- Works with Rails 3.0 now, too. Fixed the
mounted_helpers
import.