File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -168,10 +168,16 @@ You can use all these structures in models:
168168``` ruby
169169class Person < ApplicationRecord
170170 kredis_list :names
171- kredis_list :names_with_custom_key , key: -> (p ) { " person:#{ p .id} :names_customized" }
171+ kredis_list :names_with_custom_key_via_lambda , key: -> (p ) { " person:#{ p .id} :names_customized" }
172+ kredis_list :names_with_custom_key_via_method , key: :generate_names_key
172173 kredis_unique_list :skills , limit: 2
173174 kredis_enum :morning , values: %w[ bright blue black ] , default: " bright"
174175 kredis_counter :steps , expires_in: 1 .hour
176+
177+ private
178+ def generate_names_key
179+ " key-generated-from-private-method"
180+ end
175181end
176182
177183person = Person .find(5 )
You can’t perform that action at this time.
0 commit comments