diff --git a/app/models/metadata_belongs_to.rb b/app/models/metadata_belongs_to.rb index ee182a5..1438c8d 100644 --- a/app/models/metadata_belongs_to.rb +++ b/app/models/metadata_belongs_to.rb @@ -77,6 +77,10 @@ class MetadataBelongsTo < MetadataRelatedPosts @related_methods ||= %i[belongs_to belonged_to].freeze end + def indexable_values + belongs_to&.title&.value + end + private def post_exists? diff --git a/app/models/metadata_related_posts.rb b/app/models/metadata_related_posts.rb index af91c28..092f219 100644 --- a/app/models/metadata_related_posts.rb +++ b/app/models/metadata_related_posts.rb @@ -23,7 +23,7 @@ class MetadataRelatedPosts < MetadataArray end def indexable_values - values.keys + posts.where(uuid: value).map(&:title).map(&:value) end private