- Let
decorator_class
infer anonymous class decorator from superclass #820 - When inferring decorator fails, show original class instead of
ActiveRecord::Base
#821 - ActiveJob compatibility and documentation #817
- Rename UninferrableSourceError to UninferrableObjectError #768
- Remove conflicting source aliases:
source
,to_source
,source_class
andsource_class?
#786
- Generator for creating
ApplicationDecorator
that other decorators inherit from #796 - Draper configuration with ability to customize the controller Draper uses #788
- Added support for Rails 5 API-only applications #793
- Added support for Rails runner #739
- Clear view context when the controller changes #799
- Removed previously deprecated functionality #785
- Only delegate === if other is an instance of a class that inherits from
Decorator
#720 - Always default to
CollectionDecorator
whenNameError
is raised #795 - Fixed issues in order to support Rails 5.1
- Fixed a bug where helpers were used inside a decorator and this decorator was used outside of controller context
- Added support for Rails 5, dropped 4.0 - 4.2
- Ruby >= 2.2 is required, matching Rails 5
- Dropped support for ActiveModelSerializers 0.8
- Cleared most issues and merged a few PRs
- Improved behavior when decorating structs
- Improved how equality is handled
- Minor improvements to the README
Working to breathe new life into the project by shedding baggage.
- Rails 3.2 support dropped
- Ruby 1.9.3 and 2.0 support dropped
- Add support for Rails 4.2 and Ruby 2.2
- Rewrite tests to get over RSpec deprecations
- Get RSpec up to 3.2
- Try to un-screw the challenges of ActiveModelSerializers
Due to the breakages of dropping legacy support, we've bumped the major version. From here, development effort will likely focus on a version 3.0 that removes features and simplifies usage of the library.
Various bugfixes, as always.
- README improvements.
- Rails 4 compatibility. b2401c7
- Added support for testing decorators without loading
ApplicationController
. See the README for details. 4d0181f - Improved the
==
method to check fordecorated?
before attempting to compare withsource
. 6c31617 - Changed the way helpers are accessed, so that helper methods may be stubbed in tests. 7a04619
- Made the Devise test helper
sign_in
method independent of mocking framework. b0902ab - Stopped attempting to call
to_a
on decorated objects (a now-redundant lazy query workaround). 34c6390 - Fixed a minor bug where view contexts could be accidentally shared between tests. 3d07cb3
- Improved helper method performance. e6f88a5
- Our specs now use the new RSpec
expect( ).to
syntax. 9a3b319
Major changes are described in the upgrade guide.
- Infer collection decorators. e8253df
- Prevent calls to
scoped
on decorated associations. 5dcc6c3 - Add
helper
method to tests. 551961e - Inherit method security. 1865ed3
- Test against all versions of Rails 3. 1865ed3
- Pretend to be
instance_of?(source.class)
. 30d209f - Remove security from
Decorator
. Do manual delegation with:delegate
. c6f8aaa - Add generators for MiniTest. 1fac02b
- Test against edge rails. e9b71e3
- Fix up README to include changes made. 5e6e4d1
CollectionDecorator
no longer freezes its collection: direct access is discouraged by making access private. c6d60e6- A fix for
Decoratable#==
. e4fa239 - Ensure we coerce to an array in the right place. 9eb9fc9
- Change CollectionDecorator to freeze its collection. 04d7796
- Bugfix on
CollectionDecorator#to_s
. eefd7d0 - Upgrade
request_store
dependency to take advantage of a bugfix. 9f17212
- Fixed a race condition with capybara integration. e794649
[]
can be decorated again. 597fbdfmodel == decorator
as well asdecorator == model
. 46f8a68- Preliminary Mongoid integration. 892d195
- Add a helper method
sign_in
for devise in decorator specs. 66a3009 - Brought back
context
. 9609156 - Fixed issue where classes were incorrectly being looked up. ee2a015
- Integrate RequestStore for per-request storage. fde1cde
- Relaxed Rails version requirement to 3.0. Support for < 3.2 should be considered experimental. Please file bug reports.
has_finders
is nowdecorates_finders
. 33f18aa- If a finder method is used, and the source class is not set and cannot be
inferred, an
UninferrableSourceError
is raised. 8ef5bf2 - Class methods are now properly delegated again. 731995a
- We no longer
respond_to?
private methods on the source. 18ebac8 - Rails versioning relaxed to support Rails 4. 8bfd393
- Renaming
Draper::Base
toDraper::Decorator
. This is the most significant change you'll need to upgrade your application. 025742c - Added an internal Rails application for integration tests. This won't affect your application, but we're now running a set of Cucumber tests inside of a Rails app in both development and production mode to help ensure that we don't make changes that break Draper. 90a4859
- Add
#decorated?
method. This gives us a free RSpec matcher,be_decorated
. 834a6fd #decorates
is no longer needed inside your models, and should be removed. Decorators automatically infer the class they decorate. e1214d9- Decorators do not automatically come with 'finders' by default. If you'd like
to use
SomeDecorator.find(1)
, for example, simply add#has_finders
to the decorator to include them. 42b6f78 - To refer to the object being decorated,
#source
is now the preferred method. 1e84fcb ActiveModel::Serialization
is included in Decorators if you've requredActiveModel::Serializers
, so that decorators can be serialized. c4b3527- Properly support Test::Unit. 087e134
And many small bug fixes and refactorings.
See changes prior to version 1.0 here.