@@ -34,7 +34,7 @@ def find_or_create_by_path(path, attributes = {})
34
34
end
35
35
36
36
def find_all_by_generation ( generation_level )
37
- s = _ct . base_class . joins ( <<-SQL . strip_heredoc )
37
+ s = _ct . base_class . joins ( <<-SQL . squish )
38
38
INNER JOIN (
39
39
SELECT descendant_id
40
40
FROM #{ _ct . quoted_hierarchy_table_name }
@@ -70,7 +70,7 @@ def root
70
70
end
71
71
72
72
def leaves
73
- s = joins ( <<-SQL . strip_heredoc )
73
+ s = joins ( <<-SQL . squish )
74
74
INNER JOIN (
75
75
SELECT ancestor_id
76
76
FROM #{ _ct . quoted_hierarchy_table_name }
@@ -113,7 +113,7 @@ def lowest_common_ancestor(*descendants)
113
113
end
114
114
115
115
def find_all_by_generation ( generation_level )
116
- s = joins ( <<-SQL . strip_heredoc )
116
+ s = joins ( <<-SQL . squish )
117
117
INNER JOIN (
118
118
SELECT #{ primary_key } as root_id
119
119
FROM #{ _ct . quoted_table_name }
@@ -143,7 +143,7 @@ def find_by_path(path, attributes = {}, parent_id = nil)
143
143
last_joined_table = _ct . table_name
144
144
path . reverse . each_with_index do |ea , idx |
145
145
next_joined_table = "p#{ idx } "
146
- scope = scope . joins ( <<-SQL . strip_heredoc )
146
+ scope = scope . joins ( <<-SQL . squish )
147
147
INNER JOIN #{ _ct . quoted_table_name } #{ _ct . t_alias_keyword } #{ next_joined_table }
148
148
ON #{ next_joined_table } .#{ _ct . quoted_id_column_name } =
149
149
#{ connection . quote_table_name ( last_joined_table ) } .#{ _ct . quoted_parent_column_name }
0 commit comments