From d87966c1c4119dbfa0808d7bd477b59a6b5f232c Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 9 Apr 2013 08:45:02 -0400 Subject: changed variable name active_record => base_klass Current code stores the klass name in active_record and this is used throughout. While reviewing the code time and again I had the mental picture of active_record being an instance of a klass. However here the actual klass is being stored in @active_record. Secondly at two different places while referring to @active_record the comment refers to it as base klass. All this points to active_record being not the best variable name. So I thought it is better to replace active_record with base_klass. This change is confined to JoinDependency, JoinBase, JoinPart and JoinAssociation - all joining related work. --- activerecord/lib/active_record/associations/join_dependency.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/associations/join_dependency.rb') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 57fa6a8fc9..d3ceecb090 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -5,10 +5,10 @@ module ActiveRecord autoload :JoinBase, 'active_record/associations/join_dependency/join_base' autoload :JoinAssociation, 'active_record/associations/join_dependency/join_association' - attr_reader :join_parts, :reflections, :alias_tracker, :active_record + attr_reader :join_parts, :reflections, :alias_tracker, :base_klass def initialize(base, associations, joins) - @active_record = base + @base_klass = base @table_joins = joins @join_parts = [JoinBase.new(base)] @associations = {} @@ -54,7 +54,7 @@ module ActiveRecord parent }.uniq - remove_duplicate_results!(active_record, records, @associations) + remove_duplicate_results!(base_klass, records, @associations) records end @@ -109,7 +109,7 @@ module ActiveRecord case associations when Symbol, String reflection = parent.reflections[associations.intern] or - raise ConfigurationError, "Association named '#{ associations }' was not found on #{ parent.active_record.name }; perhaps you misspelled it?" + raise ConfigurationError, "Association named '#{ associations }' was not found on #{ parent.base_klass.name }; perhaps you misspelled it?" unless join_association = find_join_association(reflection, parent) @reflections << reflection join_association = build_join_association(reflection, parent) -- cgit v1.2.3