From 25cfc98b679778636276b6b126fea480bef59241 Mon Sep 17 00:00:00 2001 From: hellekin Date: Tue, 26 Jun 2018 18:32:13 +0200 Subject: [PATCH] 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. --- app/models/concerns/has_search_data.rb | 6 +++--- spec/components/concern/has_search_data_spec.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/has_search_data.rb b/app/models/concerns/has_search_data.rb index acf8f2cf53c..d93a73b900b 100644 --- a/app/models/concerns/has_search_data.rb +++ b/app/models/concerns/has_search_data.rb @@ -2,9 +2,9 @@ module HasSearchData extend ActiveSupport::Concern included do - _asscoiated_record_name = self.name.sub('SearchData', '').underscore - self.primary_key = "#{_asscoiated_record_name}_id" - belongs_to _asscoiated_record_name.to_sym + _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 diff --git a/spec/components/concern/has_search_data_spec.rb b/spec/components/concern/has_search_data_spec.rb index 8c5441b2460..9c8b3728ef3 100644 --- a/spec/components/concern/has_search_data_spec.rb +++ b/spec/components/concern/has_search_data_spec.rb @@ -35,7 +35,7 @@ describe HasSearchData do item end - it 'sets its primary key into asscoiated model' do + it 'sets its primary key into associated model' do expect(ModelItemSearchData.primary_key).to eq 'model_item_id' end