Skip to content

It should not warn about Overwriting existing field version when track_history is called more than once #252

Open
@michelleheh

Description

@michelleheh

We are getting a warning when classes are being loaded:

WARN -- : Overwriting existing field version in class MyClassA

The reason this is happening is due to the fact that we call track_history in a mixin, as well as some class itself that includes from the mixin, but other classes don't need to. Is it possible to only redefine the version field when it is previous not defined, so that track_history can be called multiple times to add more fields to track without a warning.

module Mixin
  field :common_x

  track_history on: [:fields]
end
class MyClassA
  include Mixin
  
  field :class_a_field

  track_history on: [:fields]
end
class MyClassB
  include Mixin
  
  field :class_b_field
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions