@@ -34,7 +34,7 @@ def find_or_create_by_path(path, attributes = {})
3434 end
3535
3636 def find_all_by_generation ( generation_level )
37- s = _ct . base_class . joins ( <<-SQL . strip_heredoc )
37+ s = _ct . base_class . joins ( <<-SQL . squish )
3838 INNER JOIN (
3939 SELECT descendant_id
4040 FROM #{ _ct . quoted_hierarchy_table_name }
@@ -70,7 +70,7 @@ def root
7070 end
7171
7272 def leaves
73- s = joins ( <<-SQL . strip_heredoc )
73+ s = joins ( <<-SQL . squish )
7474 INNER JOIN (
7575 SELECT ancestor_id
7676 FROM #{ _ct . quoted_hierarchy_table_name }
@@ -113,7 +113,7 @@ def lowest_common_ancestor(*descendants)
113113 end
114114
115115 def find_all_by_generation ( generation_level )
116- s = joins ( <<-SQL . strip_heredoc )
116+ s = joins ( <<-SQL . squish )
117117 INNER JOIN (
118118 SELECT #{ primary_key } as root_id
119119 FROM #{ _ct . quoted_table_name }
@@ -143,7 +143,7 @@ def find_by_path(path, attributes = {}, parent_id = nil)
143143 last_joined_table = _ct . table_name
144144 path . reverse . each_with_index do |ea , idx |
145145 next_joined_table = "p#{ idx } "
146- scope = scope . joins ( <<-SQL . strip_heredoc )
146+ scope = scope . joins ( <<-SQL . squish )
147147 INNER JOIN #{ _ct . quoted_table_name } #{ _ct . t_alias_keyword } #{ next_joined_table }
148148 ON #{ next_joined_table } .#{ _ct . quoted_id_column_name } =
149149 #{ connection . quote_table_name ( last_joined_table ) } .#{ _ct . quoted_parent_column_name }
0 commit comments