Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 3.24 KB

CHANGELOG.md

File metadata and controls

81 lines (54 loc) · 3.24 KB

Changelog

[2.0.0] - 2019-09-27

New major version as the change to the touch behavior might break existing apps and therefore is not backwards compatible.

Fixed

  • For AR >= 5.1, records are no longer touched after saving if
    • [#19] the lifecycle was halted using throw(:abort) (props to @Haniyya)
    • [#20] neither attributes nor settings were changed (basically Model.first.save)

[1.2.0]

This is a major bugfix release as the gem was basically broken when being installed in a fresh Rails 5 application.

Removed

  • The config/settings.yml file is no longer generated or referenced in the code

Changed

  • The tests now actually use the files generated by the install generator. This should ensure that both the migration and the model are always tested for compatibility with all supported Rails versions (#17)

Fixed

  • Adjusted the Gemspec to allow installation on Rails > 5.0 (#17)
  • Fixed generated migration to include version information for Rails >= 5 (#17)
  • Calls to #as_json as well as probably other parts of the AR API would fail if the gem was only included but not used (#17)

[1.1.0]

A bugfix and slight refactoring release which takes care of several issues regarding changing setting-values in-place without actually setting them before. (#13)

  • More and better specs
  • Better handling of non-existent settings through exception handling rather than multiple error prone tests

[1.0.0]

This is almost a complete refactoring of the gem which also removes some not really needed functionality.
It is the first release fully compatible with Rails 5.

New minimum versions:

  • Ruby: 2.3
  • Rails: 4.2

General

  • Removed globally defined settings (config/settings.yml) and therefore also global validations and type conversions.
    It is still possible to create global Settings, but each developer has to make sure that the assigned value is valid and correctly typed.
  • Type conversion follows AR's type conversions more strictly now.
    This means that e.g. assigning 1.0 to a boolean setting will result in true instead of nil as before.
  • Updating an attribute created through setting_accessor now leads to the record being touched,
    similar to what would happen when a normal database attribute was changed. (#4)
  • Setting a new value for an attribute created through attribute_accessor will now mark the record as "dirty", meaning changed? returns true. (#9)
    This was especially needed for Rails 5 as it only even performs a database operation in this case.

Tests

  • Tests are now written in RSpec
  • The dummy Rails application has been removed and replaced with with_model
  • Appraisal was added to test against multiple Rails versions

API Changes

  • method_missing is now part of the SettingScaffold and therefore no longer needed in the actual Setting model.
    You should remove method_missing from your model.
  • Setting.create_or_update was renamed to Setting.set and now uses a keyword argument for assignable
  • setting_accessor no longer supports the fallback option.
    If a default option is given, it is automatically used as fallback.

[0.3.0]

  • Fixed a bug that caused setting accessors not being initialized when being called as part of a rake task chain (#6)