reputation 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -11,12 +11,13 @@ class ReputationIntermediateValue < ActiveRecord::Base
|
|
11
11
|
|
12
12
|
attr_accessible :user, :rule, :name, :value
|
13
13
|
|
14
|
-
def initialize(args
|
15
|
-
|
14
|
+
def initialize(*args)
|
15
|
+
args[0] = {
|
16
16
|
:value => 0
|
17
|
-
}.merge(args)
|
17
|
+
}.merge(args.first || {})
|
18
18
|
|
19
|
-
super
|
19
|
+
super *args
|
20
20
|
end
|
21
|
+
|
21
22
|
|
22
23
|
end
|
@@ -28,4 +28,8 @@ describe ReputationBehaviour do
|
|
28
28
|
ReputationBehaviour.create!(:user => User.create!, :rule => @rule, :metric => 0).rule.should eql @rule
|
29
29
|
end
|
30
30
|
|
31
|
+
it "should be possible to recalculate a rule without raising an ArgumentError in Rails 3.1" do
|
32
|
+
expect { @user.behaviours.first.send :recalculate_rule }.should_not raise_error(ArgumentError)
|
33
|
+
end
|
34
|
+
|
31
35
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reputation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Theo Cushion
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-19 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|