]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Improve the layout of the object browser views.
[rails.git] / app / models / relation.rb
index cd2d67cdde0b969020d88530fdc82748f6f19451..a1dc9f81d646195704f3dfc2a326997c39d63157 100644 (file)
@@ -10,8 +10,8 @@ class Relation < ActiveRecord::Base
   has_many :relation_members, :foreign_key => 'id'
   has_many :relation_tags, :foreign_key => 'id'
 
-  has_many :containing_relation_members, :as => :member
-  has_many :containing_relations, :through => :containing_relation_members
+  has_many :containing_relation_members, :class_name => "RelationMember", :as => :member
+  has_many :containing_relations, :class_name => "Relation", :through => :containing_relation_members, :source => :relation
 
   def self.from_xml(xml, create=false)
     begin
@@ -257,4 +257,8 @@ class Relation < ActiveRecord::Base
     return false
   end
 
+  # Temporary method to match interface to nodes
+  def tags_as_hash
+    return self.tags
+  end
 end