Skip to content

Problem with BigDecimalWithNumericArgument cop #468

@tycooon

Description

@tycooon

I have the following code in my app:

BigDecimal("1.0")

Latest rubocop autocorrects it to the following:

BigDecimal(1.0)

The problem is it does not work and I get error:

     ArgumentError:
       can't omit precision for a Float.
1.66.1 (using Parser 3.3.5.0, rubocop-ast 1.32.3, running on ruby 3.3.5) [arm64-darwin23]
  - rubocop-factory_bot 2.26.1
  - rubocop-performance 1.22.0
  - rubocop-rails 2.26.1
  - rubocop-rake 0.6.0
  - rubocop-rspec 3.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions