@@ -202,3 +202,16 module ActionController | |||
|
202 | 202 | end |
|
203 | 203 | end |
|
204 | 204 | end |
|
205 | ||
|
206 | module CollectiveIdea | |
|
207 | module Acts | |
|
208 | module NestedSet | |
|
209 | module Model | |
|
210 | def leaf_with_new_record? | |
|
211 | new_record? || leaf_without_new_record? | |
|
212 | end | |
|
213 | alias_method_chain :leaf?, :new_record | |
|
214 | end | |
|
215 | end | |
|
216 | end | |
|
217 | end |
@@ -310,7 +310,7 module CollectiveIdea #:nodoc: | |||
|
310 | 310 | |
|
311 | 311 | # Returns true if this is the end of a branch. |
|
312 | 312 | def leaf? |
|
313 |
|
|
|
313 | persisted? && right.to_i - left.to_i == 1 | |
|
314 | 314 | end |
|
315 | 315 | |
|
316 | 316 | # Returns true is this is a child node |
General Comments 0
You need to be logged in to leave comments.
Login now