私は次のモデルを持っています:
class Point < ActiveRecord::Base
...
has_one :next_point, class_name: "Point", foreign_key: "next_point_id"
belongs_to :previous_point, class_name: "Point", foreign_key: "next_point_id"
# It should return an array with the next remaining points
def next_remaining_points
end
end
next_point が nil になるまで next_point を返すメソッドを実行するにはどうすればよいですか?