discourse/app/models/concerns/has_search_data.rb
hellekin 25cfc98b67 Fix 'asscoiated' typo
I know that **Naming is CRITICAL** and that **Refactoring only NOT welcome**.

But since I spotted this (consistent) typo and the change does not affect any
functionality -- I checked the presence of "asscoiated" in the code base, I
guess the first rule trumps the second one.

It also gave me a false pretext to bypass my reluctance to use Google forms and
sign de CLA. Typos hurt the eye.
2018-06-29 11:10:05 +10:00

11 lines
291 B
Ruby

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_presence_of :search_data
end
end