kredis
kredis copied to clipboard
Feature: delegate ID
Currently Kredis supports manually constructing a key, this is often required to capture the relationship between a user and an object:
class Widgets::Selection
kredis_set :selected_widgets, typed: :integer, key: ->(selection) { "identity:#{selection.identity.id}:selected_widgets" }
attr_accessor :identity
end
It'd be nice if Kredis supported this common scenario, generating an appropriately scoped key (useful for any future incineration):
class Widgets::Selection
kredis_set :selected_widgets, typed: :integer, identified_by: :identity
attr_accessor :identity
end