]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_relation.rb
Make more of the javascript routing functions internationalizable
[rails.git] / app / models / old_relation.rb
index 9f80a81b9fc6b1e1edd32523a93073e6fe7863af..dc89afa50294ba35710123aa382243676f04c282 100644 (file)
@@ -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)