translate_enum icon indicating copy to clipboard operation
translate_enum copied to clipboard

translate_enum in my model causes "is already defined by another enum" error

Open adevfz opened this issue 1 year ago • 1 comments

My setup Model.rb

enum :o_type, [:ordinary, :straordinary, :warranty]
 translate_enum :o_type

Adding prefix: true changes nothing, removing translate_enum :o_type resolves the issue but then I cant use the gem obviously. Does it have anything to do with the new enum syntax?

adevfz avatar Dec 21 '24 09:12 adevfz

I saw this exception as well. I resolved it by adding include TranslateEnum.

class TranslatedModel < ApplicationRecord
  include TranslateEnum # <---
  # ...
end

kmeyerhofer avatar Nov 14 '25 19:11 kmeyerhofer