Skip to content

Conflict with PG Constant in XeroRuby::Accounting::CountryCode #326

@bertiecroll

Description

@bertiecroll

The PG constant in XeroRuby::Accounting::CountryCode::PG is not being defined, causing API failures for organizations with 'PG' set as their country code. Error: Invalid ENUM value PG for class #CountryCode

This appears to be caused by a conflict when using the pg gem, which already defines a PG constant module. As a result, the conditional assignment PG ||= "PG".freeze does not behave as expected.

Given that these classes are OpenAPI generated, there may be other approaches to resolve the issue, though possible solutions could be:

  • Use a more explicit namespace for the constant assignment, e.g., CountryCode::PG ||= "PG".freeze.
  • Remove the conditional and explicitly assign all string constant values in the class.

Thanks in advance!

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