Skip to content

Can't remove DateTimes from a typed list #101

Closed
@nshki

Description

@nshki

Hello! Thank you for this wonderful gem. I came across a behavior today that could possibly be a bug—when trying to remove a DateTime instance from a typed list, it doesn't seem to work.

Here's some code that I ran in a Rails console to replicate:

datetime_list = Kredis.list("testing", typed: :datetime)
datetime_list.append([1.minute.ago, 1.hour.ago, 1.day.ago])
datetime_list.remove(datetime_list.elements.first)
datetime_list.elements #=> Still has 3 elements

This works if I don't specify typed:

datetime_list = Kredis.list("testing")
datetime_list.append([1.minute.ago, 1.hour.ago, 1.day.ago])
datetime_list.remove(datetime_list.elements.first)
datetime_list.elements #=> Only has 2 elements, so it worked!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions