discourse/app/models/concerns/has_search_data.rb
Jarek Radosz 71834c898f
DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-06 16:11:01 +02:00

12 lines
326 B
Ruby
Vendored

# frozen_string_literal: true
module HasSearchData
extend ActiveSupport::Concern
included do
_associated_record_name = self.name.sub("SearchData", "").underscore
self.primary_key = "#{_associated_record_name}_id"
belongs_to _associated_record_name.to_sym
validates :search_data, presence: true
end
end