mountain-goat 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,4 +29,27 @@ class Rally < ActiveRecord::Base
29
29
  return nil if m.nil?
30
30
  return m.data
31
31
  end
32
+
33
+ def all_metas
34
+ res = {}
35
+ self.convert_meta_types.each do |cmt|
36
+ r = res.count
37
+ begin
38
+ if cmt.var =~ /(\w)[_]id/i
39
+ if $1.classify
40
+ item = $1.classify.find( cmt.var )
41
+ if item.respond_to?(:name)
42
+ res.merge!({ $1 => item.name })
43
+ elsif item.respond_to?(:title)
44
+ res.merge!({ $1 => item.title })
45
+ end
46
+ end
47
+ end
48
+ rescue
49
+ end
50
+ res.merge!({ cmt.var => rally.meta( cmt.var ) }) if res.count == r
51
+ end
52
+
53
+ res
54
+ end
32
55
  end
@@ -1,3 +1,3 @@
1
1
  class MountainGoat
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -9,8 +9,8 @@
9
9
  <% @rallies.each do |rally| %>
10
10
  <li><%= rally.convert.name %> at <%= rally.created_at.to_s %></li>
11
11
  (
12
- <% rally.convert_meta_types.each do |cmt| %>
13
- <%= cmt.var %>: <%= rally.meta( cmt.var ) %>
12
+ <% rally.all_metas do |k,v| %>
13
+ <%= k %>: <%= v %>
14
14
  <% end %>
15
15
  )
16
16
  <% end %>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mountain-goat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 14
10
- version: 0.0.14
9
+ - 15
10
+ version: 0.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Geoffrey Hayes