draper/CHANGELOG.md

17 KiB

Draper Changelog

4.0.2 - 2021-05-27

Fixes

  • Fix kwargs usage for Ruby 3 compatibility #885
  • Fix ruby warnings for "ambiguous first argument" #881
  • Fix rake warnings in CI #897
  • Fix decoration spec #895

Other Changes

  • Migration from Travis CI to GitHub Actions #893, #896, #903

4.0.1 - 2020-03-25

Fixes

  • Check only object's private methods when preventing delegation #875

Other Changes

  • Use alias over alias_method #877

4.0.0 - 2020-02-05

Breaking Changes

  • Drop support for Ruby < 2.4 #852, #872
  • Don't delegate public methods overridden by a private method in the decorator #849

Fixes

  • Add preservation of decorator options on QueryMethods #868
  • Add #respond_to_missing? to CollectionDecorator so it correctly responds to ORM methods #850
  • Fix deprecation warning with the new Rails 6 ActionView::Base constructor #866
  • Fix deprecation warning with Ruby 2.7 #870

Other Changes

  • Add SimpleCov for code coverage analysis #851
  • Update RSpec syntax in the README #855
  • Update continuous integration configuration #861, #862, #863, #872

3.1.0

  • Rails 6 support #841
  • Include ORM query methods in CollectionDecorator (e.g. includes) #845
  • Document the fix for view context leaking in specs #847

3.0.1

  • 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

3.0.0 - 2017

Breaking Changes

  • Rename UninferrableSourceError to UninferrableObjectError #768
  • Remove conflicting source aliases: source, to_source, source_class and source_class? #786

New Features

  • 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

Other Changes

  • 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 when NameError 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

3.0.0.pre1 - 2016-07-10

  • Added support for Rails 5, dropped 4.0 - 4.2
    • Ruby >= 2.2 is required, matching Rails 5
  • Dropped support for ActiveModelSerializers 0.8

2.1.0 - 2015-03-26

  • Cleared most issues and merged a few PRs
  • Improved behavior when decorating structs
  • Improved how equality is handled
  • Minor improvements to the README

2.0.0 - 2015-03-26

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.

1.3.0 - 2013-10-26

30 commits by 11 authors

1.2.1 - 2013-05-05

28 commits by 4 authors

Various bugfixes, as always.

1.2.0 - 2013-04-01

78 commits by 14 authors

1.1.0 - 2013-01-28

44 commits by 6 authors

  • 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 for decorated? before attempting to compare with source. 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

1.0.0 - 2013-01-14

249 commits by 19 authors

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

1.0.0.beta6 - 2012-12-31

  • 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

1.0.0.beta5 - 2012-12-27

  • Change CollectionDecorator to freeze its collection. 04d7796
  • Bugfix on CollectionDecorator#to_s. eefd7d0
  • Upgrade request_store dependency to take advantage of a bugfix. 9f17212

1.0.0.beta4 - 2012-12-18

  • Fixed a race condition with capybara integration. e794649
  • [] can be decorated again. 597fbdf
  • model == decorator as well as decorator == 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

1.0.0.beta3 - 2012-12-03

  • Relaxed Rails version requirement to 3.0. Support for < 3.2 should be considered experimental. Please file bug reports.

1.0.0.beta2 - 2012-12-03

  • has_finders is now decorates_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

1.0.0.beta1 - 2012-11-30

  • Renaming Draper::Base to Draper::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 requred ActiveModel::Serializers, so that decorators can be serialized. c4b3527
  • Properly support Test::Unit. 087e134

And many small bug fixes and refactorings.

0.x

See changes prior to version 1.0 here.