X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9544ab12b8237b4e471f03df981a189c80216c63..23ffdadb565be5ccc4ae9fad9647bdf0fa9b8683:/app/models/old_relation.rb diff --git a/app/models/old_relation.rb b/app/models/old_relation.rb index 284efd09c..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.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)