mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
move ivar to initialize, use triple dot rather than minus
This commit is contained in:
@@ -37,6 +37,7 @@ module ActiveRecord
|
||||
@join_dependency = join_dependency
|
||||
@parent = parent
|
||||
@join_type = Arel::InnerJoin
|
||||
@aliased_prefix = "t#{ join_dependency.join_parts.size }"
|
||||
|
||||
# This must be done eagerly upon initialisation because the alias which is produced
|
||||
# depends on the state of the join dependency, but we want it to work the same way
|
||||
@@ -97,7 +98,6 @@ module ActiveRecord
|
||||
private
|
||||
|
||||
def allocate_aliases
|
||||
@aliased_prefix = "t#{ join_dependency.join_parts.size }"
|
||||
@aliased_table_name = aliased_table_name_for(table_name)
|
||||
|
||||
if reflection.macro == :has_and_belongs_to_many
|
||||
|
||||
@@ -12,7 +12,7 @@ module ActiveRecord
|
||||
|
||||
# Truncates a table alias according to the limits of the current adapter.
|
||||
def table_alias_for(table_name)
|
||||
table_name[0..table_alias_length-1].gsub(/\./, '_')
|
||||
table_name[0...table_alias_length].gsub(/\./, '_')
|
||||
end
|
||||
|
||||
# def tables(name = nil) end
|
||||
|
||||
Reference in New Issue
Block a user