diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-04-09 08:45:02 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-04-09 08:53:10 -0400 |
commit | d87966c1c4119dbfa0808d7bd477b59a6b5f232c (patch) | |
tree | d017667b23964d94b6778142794416b5ffc26aa8 /activerecord/lib/active_record/associations/join_dependency.rb | |
parent | d20c3204bf99d7828be101519d6711dc5f26d2ce (diff) | |
download | rails-d87966c1c4119dbfa0808d7bd477b59a6b5f232c.tar.gz rails-d87966c1c4119dbfa0808d7bd477b59a6b5f232c.tar.bz2 rails-d87966c1c4119dbfa0808d7bd477b59a6b5f232c.zip |
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.
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 8 |
1 files changed, 4 insertions, 4 deletions
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) |