projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
343e01b
)
When calling .tags or .segs on a way, if it's an existing one, use the data from...
author
Nick Burch
<openstreetmap@gagravarr.org>
Sun, 22 Apr 2007 14:46:25 +0000
(14:46 +0000)
committer
Nick Burch
<openstreetmap@gagravarr.org>
Sun, 22 Apr 2007 14:46:25 +0000
(14:46 +0000)
app/models/way.rb
patch
|
blob
|
history
diff --git
a/app/models/way.rb
b/app/models/way.rb
index 7dffcfef1886bf456f1610d8bab944b347c36c67..b7d0ec118f92bf3c4e5e239173e7179d842527d3 100644
(file)
--- a/
app/models/way.rb
+++ b/
app/models/way.rb
@@
-78,12
+78,22
@@
class Way < ActiveRecord::Base
def segs
- @segs = Array.new unless @segs
+ unless @segs
+ @segs = Array.new
+ self.way_segments.each do |seg|
+ @segs += [seg.segment_id]
+ end
+ end
@segs
end
def tags
- @tags = Hash.new unless @tags
+ unless @tags
+ @tags = Hash.new
+ self.way_tags.each do |tag|
+ @tags[tag.k] = tag.v
+ end
+ end
@tags
end