3993: Remove extra fields from BaseItem
Fixes #3993 .
...ok, barcode_count is in a bunch of specs and I don't know why. It looks like it never actually worked?
I may be misinterpreting the variable. I don't know why you would want to know the number of items with barcodes for each base item (and hence have no idea why we had the variable in the first place).
REvisiting this. I don't know what the barcode_count was supposed to do -- I don't see anywhere where it has any effect. So I'd be ok with experimenting to see if anything blows up if we remove those.
Problem. Over in BarcodeItem model we have
belongs_to :barcodeable, polymorphic: true, dependent: :destroy, counter_cache: :barcode_count
which means that everything which is barcodeable needs to have a barcode_count, if I understand correctly. And base items are barcodeable.
So it looks like we had an entire feature, "global barcodes", which is accessible only for a super admin. The idea seems to have been that we attach barcodes to BaseItems and then we can use those to look up the corresponding Item for that organization. Seems like half the tests related to barcodes assume we have these items.
But the DB doesn't have a single instance of a BarcodeItem that belongs to a BaseItem. Looks like we never actually went ahead and added the data. So I think we're safe to get rid of this feature as well.
Oh - I thought it was a way that we could help new people get totally set up -- that items made from the base items would have these pre-set.
I'd prefer to know what the benefit was supposed to be -- but if it's really not being used, and no one has mentioned it in a stakeholder meeting in the last 2 years -- excising it probably makes sense.
That being said, I'd want to have some manual bar code testing done in case there is some dependency we've missed: @scooter-dangle -- can you do that?
Hm... we should probably also check if it is in the setup video. I rather doubt it is.
Where are we at with this one -- close completely in favor of work toward removing global barcodes and re-imagining base items?
I'd say let's get rid of global barcodes first and then revisit this. I'll close the PR for now because there are tons of conflicts anyway.