Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test sql

  • Loading branch information...
commit 184a28eb2d670a73e30d0431bcb44c22d3088848 1 parent ae88426
mark authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/helpers/orgchartgem/charts_helper.rb
View
5 app/helpers/orgchartgem/charts_helper.rb
@@ -4,11 +4,12 @@ module ChartsHelper
def chartNodes(chartId)
- origin = Node.all(
+ origin = Node.find(Node.all(
+ :select => 'nodes.id',
:conditions => ["chart_id = ?", chartId],
:joins => 'LEFT JOIN "parents_children" ON "parents_children"."child_id" = "nodes"."id"',
:group => "parent_id",
- :having => "count(parent_id) <= 0").first
+ :having => "count(parent_id) <= 0").first)
return buildOrg(origin).to_json if origin
end
Please sign in to comment.
Something went wrong with that request. Please try again.