X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/baea8dc10eb0399e37850cc5ab857f392f780f1f..2efd73c672dae8f6956024638b4b090961e74781:/app/models/relation.rb diff --git a/app/models/relation.rb b/app/models/relation.rb index 25564940b..4200a08dd 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -130,7 +130,7 @@ class Relation < ApplicationRecord end def tags - @tags ||= relation_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= relation_tags.to_h { |t| [t.k, t.v] } end attr_writer :members, :tags @@ -206,6 +206,8 @@ class Relation < ApplicationRecord 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