Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Availability counts broken #1641

Closed
Closed
@esoterik

Description

@esoterik

Discovered today:

In the cart validations, we call count on a list of reservations, expecting it to behave like Enumerable#count, but the object is actually an ActiveRecordRelation so the method behaves differently. (The block we pass isn't taken into account; we just get the size of the relation instead of the count we're expecting).

We need to convert the collection to an array before calling count; we should also make sure that this error isn't elsewhere in the code.

The issue is not occurring on deployed instances, fortunately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions