triumph 0.2.1 → 0.2.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -15,6 +15,7 @@ module Triumph
15
15
  # GET /achievements/1.xml
16
16
  def show
17
17
  @achievement = Achievement.find(params[:id])
18
+ @conditions = @achievement.achievement_conditions
18
19
 
19
20
  respond_to do |format|
20
21
  format.html # show.html.erb
@@ -27,5 +27,13 @@ module Triumph
27
27
  end
28
28
  end
29
29
 
30
+ def to_s
31
+ condition = achievement_conditions.first
32
+
33
+ return "Grant this achievement when a user has more than #{quantity} #{observe_class.pluralize}
34
+ and there are #{condition.total_operator} #{condition.total_value}
35
+ where #{condition.comparison_attribute} is
36
+ #{condition.comparison_operator} #{condition.comparison_value}"
37
+ end
30
38
  end
31
39
  end
@@ -4,9 +4,7 @@
4
4
  <tr>
5
5
  <th>Name</th>
6
6
  <th>Description</th>
7
- <th>Observe class</th>
8
7
  <th>Conditions</th>
9
- <th>Quantity</th>
10
8
  <th></th>
11
9
  <th></th>
12
10
  <th></th>
@@ -16,9 +14,7 @@
16
14
  <tr>
17
15
  <td><%= achievement.name %></td>
18
16
  <td><%= achievement.description %></td>
19
- <td><%= achievement.observe_class %></td>
20
- <td><%= achievement.conditions %></td>
21
- <td><%= achievement.quantity %></td>
17
+ <td><%= achievement %></td>
22
18
  <td><%= link_to 'Show', achievement %></td>
23
19
  <td><%= link_to 'Edit', edit_triumph_achievement_path(achievement) %></td>
24
20
  <td><%= link_to 'Destroy', achievement, :confirm => 'Are you sure?', :method => :delete %></td>
@@ -11,20 +11,8 @@
11
11
  </p>
12
12
 
13
13
  <p>
14
- <b>Observe class:</b>
15
- <%= @achievement.observe_class %>
14
+ <%= @achievement %>
16
15
  </p>
17
16
 
18
- <p>
19
- <b>Conditions:</b>
20
- <%= @achievement.conditions %>
21
- </p>
22
-
23
- <p>
24
- <b>Quantity:</b>
25
- <%= @achievement.quantity %>
26
- </p>
27
-
28
-
29
17
  <%= link_to 'Edit', edit_triumph_achievement_path(@achievement) %> |
30
18
  <%= link_to 'Back', triumph_achievements_path %>
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{triumph}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adam Bray"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: triumph
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.1
5
+ version: 0.2.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Adam Bray
@@ -156,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- hash: 2010006227418304460
159
+ hash: 1793603896583687947
160
160
  segments:
161
161
  - 0
162
162
  version: "0"