take-five/acts_as_ordered_tree — pull request #27 by Napolskih (2014-02-18 06:32:29+00:00)
Title: Optimize leaf? method

```SQL
SELECT COUNT(*) FROM "product_groups" WHERE "product_groups"."parent_id" = 24545 AND (company_id = 98154223)
vs
SELECT 1 FROM "product_groups" WHERE "product_groups"."parent_id" = 24545 AND (company_id = 98154223) LIMIT 1
```