Global search
# avo-2
r
Hey Guys, I'm facing some issues with global search(Avo V2). **Error**: NoMethodError (undefined method `to_model' for #<ActiveStorage::Attached::Many:0x000000010bd100b8 @name="media", @record=#"question", "label"=>"label"}], title: "title for sport", sub_title: "sub title", fulfillment: "dropshipping", artist_id: 1, release_id: 12, created_at: "2023-08-24 19:40:31.963378000 +0000", updated_at: "2023-08-28 14:50:37.950945000 +0000">>) **Model**:
Copy code
class Merchandise < ApplicationRecord
  include Ransackable
  extend FriendlyId

  has_many_attached :media
end
When I chaged the
has_many_attached
to
has_one_attached
for :`media` fields it works perfectly. I should open a Issue?
l
Hello @rough-library-77794 yes please open a issue with more details about your configuration so we can replicate the bug
r
Working on it
l
Thanks
r
@loud-jewelry-99127 there you go https://github.com/avo-hq/avo/issues/1940 🙌
l
I'll have a look when get the change and give you feedback on the issue
r
Thanks @loud-jewelry-99127, its working 🙌
l
Anytime! Glad that's working!