Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Releases: stevegeek/encoded_id-rails

V1.0.0.rc1

09 Apr 22:24
Compare
Choose a tag to compare
V1.0.0.rc1 Pre-release
Pre-release

[1.0.0] - (in beta)

Breaking changes

  • Ruby < 3.2 support dropped. The minimum supported Ruby version is now 3.2.0
  • #encoded_id now defaults to returning an 'annotated' ID, one in which a prefix is added to the encoded ID to indicate
    the 'type' of the record the ID represents. This can be disabled. IDs generated by older versions of this gem will
    decode correctly. But not that IDs generated by this version onwards will not decode correctly by older versions of this
    gem so make sure to disable annotation if you need to support older versions of this gem.
  • #name_for_encoded_id_slug no longer provides a default implementation, it is up to the user to define this method,
    or configure the gem to use a different method name.
  • #slugged_encoded_id no longer takes a with: parameter. To specify the name of the method to call to generate the
    slug, use the slug_value_method_name configuration option.

Added

  • New EncodedId::Rails::Persists module which adds hooks to the model to persist the encoded ID to the DB (see docs).
  • #encoded_id_hash has been added to return only the encoded ID without an annotation prefix. If annotation is disabled,
    this method is basically an alias to #encoded_id.
  • .find_all_by_encoded_id has been added to return all records matching the given encoded ID. This will return all
    matching records whose IDs are encoded in the encoded_id. Missing records are ignored.
  • .find_all_by_encoded_id! like .find_all_by_encoded_id but raises an ActiveRecord::RecordNotFound exception if
    any of the records are not found.
  • Configuration#model_to_param_returns_encoded_id to allow EncodedId::Rails::Model inclusion to also bring in
    EncodedId::Rails::PathParam automatically.

Fixed

  • #decode_encoded_id now raises if the encoded ID is not a string.
  • Handle more cases where a record held onto a memoized encoded_id even though its id had changed

1.0.0.beta2

23 Oct 05:17
Compare
Choose a tag to compare
1.0.0.beta2 Pre-release
Pre-release

1.0.0.beta1

07 Aug 19:36
Compare
Choose a tag to compare
1.0.0.beta1 Pre-release
Pre-release
Bump 1.0.0.beta1

v0.6.2

09 Feb 16:19
Compare
Choose a tag to compare
v0.6.2 Pre-release
Pre-release
  • Fix encoded_id memoization clearing when record is duplicated

v0.6.1

09 Feb 15:44
Compare
Choose a tag to compare
v0.6.1 Pre-release
Pre-release
  • Fix #encoded_id to return nil if #id is nil
  • Ensure encoded_id memoization is cleared when record is duplicated, or id changes

v0.6.0

21 Dec 15:40
Compare
Choose a tag to compare
v0.6.0 Pre-release
Pre-release
  • Rename WithEncodedId to Model
  • Introduce optional mixins for overriding #to_param

v0.5.0

21 Dec 10:09
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

name_for_encoded_id_slug no longer uses the return value from name but rather just uses the class name.

If you want to change the name used in the slug, override name_for_encoded_id_slug

v0.4.0

18 Dec 17:45
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release

Refactor internals, remove any methods not actually related to encoded_id, eg slugged_id

v0.3.1

15 Dec 11:49
Compare
Choose a tag to compare
v0.3.1 Pre-release
Pre-release

Fix default config

0.3.0

15 Dec 11:26
Compare
Choose a tag to compare
0.3.0 Pre-release
Pre-release

Updates encoded_id and fixes configuration