]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Introduce relation member limit
[rails.git] / app / models / relation.rb
index a231feddb7fe45427ab5039a1b453e6adce393f6..4200a08dd7c709da827e405759c7d5df968a5672 100644 (file)
@@ -206,6 +206,8 @@ class Relation < ApplicationRecord
   end
 
   def preconditions_ok?(good_members = [])
   end
 
   def preconditions_ok?(good_members = [])
+    raise OSM::APITooManyRelationMembersError.new(id, members.length, Settings.max_number_of_relation_members) if members.length > Settings.max_number_of_relation_members
+
     # These are hastables that store an id in the index of all
     # the nodes/way/relations that have already been added.
     # If the member is valid and visible then we add it to the
     # These are hastables that store an id in the index of all
     # the nodes/way/relations that have already been added.
     # If the member is valid and visible then we add it to the