I'm trying to add a column to Spree::Product for a...
# support
c
I'm trying to add a column to Spree::Product for a shipping refrigeration setting. I'm having trouble debugging an error when trying to make this enum: `gems/3.0.0/gems/activerecord-6.1.7/lib/active_record/enum.rb294in
raise_conflict_error': *You tried to define an enum named "refrigeration" on the model "Spree::Product", but this will generate a instance method "room?", which is already defined by another enum. (ArgumentError)*
Regardless of what I set the enum text values to it throws the same error. Is it being prepended twice?
✅ 1
I just made a quick workaround, but just curious why I was running into this error...
j
Yeah, you can give the enum methods a prefix to work around it, but I would open a console and figure out where the pre-existing room? method came from, using pry or something.
Unless somehow your module is getting loaded twice or something
c
I tried to give them a suffix or a prefix and I got the same error, so it must be getting loaded twice somewhere. Ah maybe it's the extension I made that uses this same method to load? I'm learning how to do extensions so that may be it, I'll look around. Thanks
j
A little puts debugging will tell you if it’s loaded twice.
✅ 1
Or just throw a pry in it
c
Yup! Bug in my extension, thanks!
sg horns 1