@tomhughes commented on this pull request.


> +    @ways = @changeset.old_ways
+                      .order(:way_id, :version)
+                      .offset(ELEMENTS_PER_PAGE * (@current_way_page - 1))
+                      .limit(ELEMENTS_PER_PAGE)
+  end
+
+  def load_relations
+    @relations_count = @changeset.actual_num_changed_relations
+    @current_relation_page = params[:relation_page].to_i.clamp(1, 
element_pages_count(@relations_count))
+    @relations = @changeset.old_relations
+                           .order(:relation_id, :version)
+                           .offset(ELEMENTS_PER_PAGE * (@current_relation_page 
- 1))
+                           .limit(ELEMENTS_PER_PAGE)
+  end
+
+  helper_method def element_pages_count(elements_count)

Did you see the way of using `helper_method` somewhere? I can guess why it 
works, but it's not how the rails documentation shows it being used or how we 
use it elsewhere... We normally declare the method as normal and then add 
`helper_method :method_name` to make it a helper.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6316#pullrequestreview-3111981625
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6316/review/3111981...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to