- Ruby 2.7.x support dropped. The minimum supported Ruby version is now 3.0.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 awith:
parameter. To specify the name of the method to call to generate the slug, use theslug_value_method_name
configuration option.
#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 anActiveRecord::RecordNotFound
exception if any of the records are not found.
#decode_encoded_id
now raises if the encoded ID is not a string.
- Fix
encoded_id
memoization clearing when record is duplicated
- Fix
#encoded_id
to return nil if#id
is nil - Ensure
encoded_id
memoization is cleared when record is duplicated, or id changes
- Rename mixin to
Model
- Introduce optional mixins for overriding
#to_param
name_for_encoded_id_slug
no longer uses the return value from name but rather just uses theclass
name
.- If you want to change the name used in the slug, override
name_for_encoded_id_slug
- Refactor internals, remove any methods not actually related to creating
encoded_id
, (egslugged_id
was removed).
- Fix default config
- Updates gem
encoded_id
dependency and fixes configuration
- No notes...
- Initial release