mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 07:13:44 +08:00
25cfc98b67
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.
11 lines
291 B
Ruby
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
|