recognition 0.8.1 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/recognition/models/redeemable.rb +5 -2
- data/lib/recognition/version.rb +1 -1
- metadata +4 -4
@@ -51,25 +51,28 @@ module Recognition
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def redeem recognizable
|
54
|
+
pass = false
|
54
55
|
# Make sure we have an amount beforehand
|
55
56
|
if defined? self.amount
|
56
57
|
if self.redeemable? recognizable
|
57
58
|
# Call custom validators
|
58
|
-
if
|
59
|
+
if self.class.redemption_validators.present?
|
59
60
|
self.class.redemption_validators.each do |validator|
|
60
61
|
# quit if any validator returned false
|
61
62
|
if send(validator) == false
|
62
63
|
Recognition.log self.class.to_s.downcase.to_sym, "validation error for #{self.class.to_s}##{self.id}: custom validation error"
|
63
|
-
return
|
64
|
+
return pass
|
64
65
|
end
|
65
66
|
end
|
66
67
|
end
|
67
68
|
# If all went well:
|
68
69
|
execute_redemption recognizable.id
|
70
|
+
pass = true
|
69
71
|
end
|
70
72
|
else
|
71
73
|
Recognition.log self.class.to_s.downcase.to_sym, "validation error for #{self.class.to_s}##{self.id}: amount is nil"
|
72
74
|
end
|
75
|
+
pass
|
73
76
|
end
|
74
77
|
|
75
78
|
|
data/lib/recognition/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recognition
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
segments:
|
186
186
|
- 0
|
187
|
-
hash: -
|
187
|
+
hash: -2859555224088050591
|
188
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
189
|
none: false
|
190
190
|
requirements:
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
segments:
|
195
195
|
- 0
|
196
|
-
hash: -
|
196
|
+
hash: -2859555224088050591
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
199
|
rubygems_version: 1.8.23
|