merit 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -48,6 +48,12 @@ holds. Badges may have levels, and may be temporary. Define rules on
48
48
  user.name.present? && user.address.present?
49
49
  end
50
50
 
51
+ ## Grant manually
52
+
53
+ You may also grant badges "by hand":
54
+
55
+ Badge.find(3).grant_to(current_user)
56
+
51
57
  ---
52
58
 
53
59
  # Defining point rules
@@ -106,14 +112,6 @@ Check for rules on a rake task executed in background like:
106
112
 
107
113
  ---
108
114
 
109
- # Grant manually
110
-
111
- You may also add badges "by hand" from controller actions:
112
-
113
- Badge.find(3).grant_to(current_user)
114
-
115
- ---
116
-
117
115
  # MongoMapper support (experimental)
118
116
 
119
117
  You may use <tt>merit</tt> with <tt>mongo_mapper</tt> ORM by calling
@@ -123,32 +121,10 @@ installation, and configuring <tt>config.orm = :mongo_mapper</tt> in
123
121
 
124
122
  ---
125
123
 
126
- # Notes on upgrades
127
-
128
- ## to 0.4.0
129
-
130
- Rankings are now integer attributes on "meritable" models ("<tt>level</tt>"),
131
- they are not badges anymore. <tt>set_rank</tt> now doesn't accept
132
- <tt>badge_name</tt>.
133
-
134
- ## to 0.3.0
135
-
136
- Badges data is now stored in <tt>config/initializers/merit.rb</tt> using
137
- <tt>ambry</tt> syntax (not in the DB anymore, as that table needed to be in
138
- sync in all development environments).
139
-
140
- ## to 0.2.0
141
-
142
- Added <tt>had_errors</tt> boolean attribute to <tt>merit_actions</tt> table.
143
-
144
- ---
145
-
146
124
  # To-do list
147
125
 
148
126
  * rescue ActiveRecord::... should depend on ORM used (MongoMapper?)
149
127
  * Why 1.8.7 tests are not passing?
150
- * Ranking should not be badges, so .badges doesn't return them (2-stars
151
- shouldn't be badge).
152
128
  * :value parameter (for star voting for example) should be configurable
153
129
  (depends on params[:value] on the controller).
154
130
  * Make fixtures for integration testing (now creating objects on test file!).
data/Rakefile CHANGED
@@ -24,6 +24,6 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
24
24
  rdoc.rdoc_dir = 'rdoc'
25
25
  rdoc.title = 'Merit'
26
26
  rdoc.options << '--line-numbers' << '--inline-source'
27
- rdoc.rdoc_files.include('README.rdoc')
27
+ rdoc.rdoc_files.include('README.md')
28
28
  rdoc.rdoc_files.include('lib/**/*.rb')
29
29
  end
@@ -0,0 +1,16 @@
1
+ # Upgrading
2
+
3
+ ## to 0.4.0
4
+
5
+ Rankings are now integer attributes (<tt>level</tt>), they are not badges
6
+ anymore. <tt>set_rank</tt> doesn't accept <tt>badge_name</tt> anymore.
7
+
8
+ ## to 0.3.0
9
+
10
+ Badges data is now stored in <tt>config/initializers/merit.rb</tt> using
11
+ <tt>ambry</tt> syntax (not in the DB anymore, as that table needed to be in
12
+ sync in all development environments).
13
+
14
+ ## to 0.2.0
15
+
16
+ Added <tt>had_errors</tt> boolean attribute to <tt>merit_actions</tt> table.
@@ -26,7 +26,7 @@ class MeritAction
26
26
  else
27
27
  begin
28
28
  target = target_object.send(to)
29
- rescue ActiveRecord::RecordNotFound
29
+ rescue NoMethodError
30
30
  Rails.logger.warn "[merit] No target_object found on check_rules."
31
31
  return
32
32
  end
@@ -49,7 +49,7 @@ module Merit
49
49
  else
50
50
  begin
51
51
  action.target_object(model_name).send(to)
52
- rescue ActiveRecord::RecordNotFound
52
+ rescue NoMethodError
53
53
  Rails.logger.warn "[merit] #{action.target_model.singularize}.find(#{action.target_id}) not found, no badges giving today"
54
54
  return
55
55
  end
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.summary = "General reputation Rails engine."
6
6
  s.description = "General reputation Rails engine."
7
7
  s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
  s.authors = ["Tute Costa"]
10
10
  s.email = 'tutecosta@gmail.com'
11
11
  s.add_dependency 'ambry'
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: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ambry
16
- requirement: &70321858339760 !ruby/object:Gem::Requirement
16
+ requirement: &70347082614520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70321858339760
24
+ version_requirements: *70347082614520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rails
27
- requirement: &70321858339140 !ruby/object:Gem::Requirement
27
+ requirement: &70347082613580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70321858339140
35
+ version_requirements: *70347082613580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &70321858337900 !ruby/object:Gem::Requirement
38
+ requirement: &70347082612740 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70321858337900
46
+ version_requirements: *70347082612740
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: haml
49
- requirement: &70321858336840 !ruby/object:Gem::Requirement
49
+ requirement: &70347082371420 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70321858336840
57
+ version_requirements: *70347082371420
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: capybara
60
- requirement: &70321858330240 !ruby/object:Gem::Requirement
60
+ requirement: &70347082370560 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70321858330240
68
+ version_requirements: *70347082370560
69
69
  description: General reputation Rails engine.
70
70
  email: tutecosta@gmail.com
71
71
  executables: []
@@ -75,8 +75,9 @@ files:
75
75
  - Gemfile
76
76
  - Gemfile.lock
77
77
  - MIT-LICENSE
78
- - README.markdown
78
+ - README.md
79
79
  - Rakefile
80
+ - UPGRADING.md
80
81
  - app/models/badge.rb
81
82
  - app/models/merit_action.rb
82
83
  - lib/generators/active_record/merit_generator.rb