Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
michelleheh opened this issue Nov 12, 2021 · 0 comments
Labels

Comments

@michelleheh
Copy link

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
@michelleheh michelleheh changed the title It should not warn about Overwriting existing field version when track_history is call more than once It should not warn about Overwriting existing field version when track_history is called more than once Nov 13, 2021
@dblock dblock added the bug? label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants