Skip to content

Commit

Permalink
fixed the hack... sigh
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Spencer committed Nov 10, 2008
1 parent fd6217b commit 26e6eb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ext_tree_extensions/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def build_tree treenode, opts = {}

if opts[:checked_tree] #&& opts[:checked_ids]
node[:checked] = opts[:checked_ids].include?(treenode.id) ? true : false
node[:depth] = treenode.ancestors.size rescue = 0 #FIXME: this is horrible, and is only here because some things screw up if you make a model a tree (e.g. add lft, rgt and parent_id) after some records have already been added (gives an SQL error)
node[:depth] = treenode.ancestors.size rescue 0 #FIXME: this is horrible, and is only here because some things screw up if you make a model a tree (e.g. add lft, rgt and parent_id) after some records have already been added (gives an SQL error)
end

node
Expand Down

0 comments on commit 26e6eb3

Please sign in to comment.