Agree, this alternative reads better, and both options return nil.

Alternatively you could use until and leave the condition positive:

    until node.equal? NULL
      yield node
      node = node.parent
    end

Would you like to volunteer a PR? (Please /cc @fxn if you do.)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to