merit 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -169,5 +169,4 @@ end
169
169
 
170
170
  * Move level from meritable model into Sash
171
171
  * `ActivityLog` should replace `add_points` `log` parameter
172
- * Extract logging from `Judge` to an Observer. See http://www.rubytapas.com/episodes/21-Domain-Model-Events
173
172
  * FIXMES and TODOS.
@@ -30,11 +30,11 @@ module Merit
30
30
  end
31
31
 
32
32
 
33
- def points(category = :default)
33
+ def points(category = 'default')
34
34
  scores.where(category: category).first.points
35
35
  end
36
36
 
37
- def add_points(num_points, log = 'Manually granted', category = :default)
37
+ def add_points(num_points, log = 'Manually granted', category = 'default')
38
38
  point = Merit::Score::Point.new
39
39
  point.log = log
40
40
  point.num_points = num_points
@@ -42,7 +42,7 @@ module Merit
42
42
  point
43
43
  end
44
44
 
45
- def substract_points(num_points, log = 'Manually granted', category = :default)
45
+ def substract_points(num_points, log = 'Manually granted', category = 'default')
46
46
  add_points -num_points, log, category
47
47
  end
48
48
 
@@ -33,7 +33,7 @@ FROM #{options[:table_name]}
33
33
  LEFT JOIN merit_scores ON merit_scores.sash_id = #{sash_id_column}
34
34
  LEFT JOIN merit_score_points ON merit_score_points.score_id = merit_scores.id
35
35
  WHERE merit_score_points.created_at > '#{options[:since_date]}'
36
- GROUP BY merit_scores.sash_id
36
+ GROUP BY #{options[:table_name]}.id, merit_scores.sash_id
37
37
  ORDER BY sum_points DESC
38
38
  LIMIT #{options[:limit]}
39
39
  SQL
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.description = "Manage badges, points and rankings (reputation) of resources in a Rails application."
5
5
  s.homepage = "http://github.com/tute/merit"
6
6
  s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
7
- s.version = '1.6.0'
7
+ s.version = '1.6.1'
8
8
  s.authors = ["Tute Costa"]
9
9
  s.email = 'tutecosta@gmail.com'
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
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-04-30 00:00:00.000000000 Z
12
+ date: 2013-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ambry