Skip to content

0 % <ActiveSupport::Duration> returns unexpected result #31302

@moveson

Description

@moveson

Steps to reproduce

From the Rails console:
>> a = 0 % 1.second
>> a
#>

Expected behavior

a should report its existence as 0.

Actual behavior

a returns nothing at all: No 0, no nil, no indication of what it is. However,

>> a.zero?
#> true

System configuration

Rails version: 5.1.4

Ruby version: 2.3.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions