X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/10e92b85a730836abe2d7c0564da0b5c55154f95..9d8ab7dbd11f9fff0faf82b948bf1a07e86aa5b7:/app/models/old_relation.rb diff --git a/app/models/old_relation.rb b/app/models/old_relation.rb index 9f80a81b9..dc89afa50 100644 --- a/app/models/old_relation.rb +++ b/app/models/old_relation.rb @@ -60,24 +60,13 @@ class OldRelation < ActiveRecord::Base end def members - unless @members - @members = Array.new - self.old_members.order(:sequence_id).each do |m| - @members += [[m.type,m.id,m.role]] - end + @members ||= self.old_members.collect do |member| + [member.member_type, member.member_id, member.member_role] end - @members end def tags - unless @tags - @tags = Hash.new - self.old_tags.each do |tag| - @tags[tag.k] = tag.v - end - end - @tags = Hash.new unless @tags - @tags + @tags ||= Hash[self.old_tags.collect { |t| [t.k, t.v] }] end def members=(s)