merit 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7d2cd9366ca515998303997aa8b9f30d7ab3e9f
4
- data.tar.gz: 7be13cb7255f3d90760360827f07f6d57a2b1376
3
+ metadata.gz: e3ba1793a99e686187f57a5a9c55c4244ac12593
4
+ data.tar.gz: efec89f69825fc1a398ab865fd013af76aff760a
5
5
  SHA512:
6
- metadata.gz: d1ee7dde0226e826d7244c5370ceb9edc8d9bd2d6340a36ba2219c229ea2103e2e891f4fef00708afd9e024bc4b6352fb1a07ba6825a7fc5168385ba18b1abab
7
- data.tar.gz: 150e480cb899d7f88ad9ff85f4f7fe4bd19ce2936823454717d27b50ed286809e2a7e6b92b2f0f3fd81600132189f381c8e79ad95aa6e39279537182e392b919
6
+ metadata.gz: da93660057b6c2fe71593df135de01f7bc724cd8951ca7e4a189447123493ebf1de48a45c25e7a0ccddfed12bac919c83020c1975ab5050e72d261b436f1c8cd
7
+ data.tar.gz: ff2b6c3f86e9f8d3a14044570f1dc5e002884e80fd8d1b7fb83e0033f60eb6ff8cbe085feab88dab06938aae576cdd75538337e3aa0b32380a24d53ac2c29db0
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.1
4
+
5
+ - [#204] Sash creation bugfix on certain conditions
6
+ - [733da49] Improve examples and docs for points `on` option
7
+
3
8
  ## 2.3.0
4
9
 
5
10
  - [#206] Allow Rule to find Badge by `badge_id`
data/Gemfile CHANGED
@@ -29,7 +29,7 @@ end
29
29
 
30
30
  group :development, :test do
31
31
  gem 'activerecord-jdbcsqlite3-adapter', :platforms => [:jruby]
32
- gem 'sqlite3', '1.3.8', :platforms => [:ruby, :mswin, :mingw]
32
+ gem 'sqlite3', '~> 1.3.8', :platforms => [:ruby, :mswin, :mingw]
33
33
  end
34
34
 
35
35
  platforms :rbx do
data/README.md CHANGED
@@ -125,7 +125,7 @@ current_user.rm_badge(badge.id)
125
125
 
126
126
  ```ruby
127
127
  # Get related entries of a given badge
128
- Badge.find(1).users
128
+ Merit::Badge.find(1).users
129
129
  ```
130
130
 
131
131
  ## Displaying Badges
@@ -156,7 +156,7 @@ action user or to the method(s) defined in the `:to` option. Define rules on
156
156
  * `Integer`
157
157
  * `Proc`, or any object that accepts `call` which takes one argument, where
158
158
  the target_object is passed in and the return value is used as the score.
159
- * `:on` action as string or array of strings (similar to Rails routes)
159
+ * `:on` action as string or array of strings (like `controller#action`, similar to Rails routes)
160
160
  * `:to` method(s) to send to the target_object (who should be scored?)
161
161
  * `:model_name` (optional) to specify the model name if it cannot be guessed
162
162
  from the controller. (e.g. `model_name: 'User'` for `RegistrationsController`,
@@ -20,7 +20,7 @@ module Merit
20
20
 
21
21
  # Check rules defined for a merit_action
22
22
  def check_all_rules
23
- processed!
23
+ mark_as_processed!
24
24
  return if had_errors
25
25
 
26
26
  check_rules rules_matcher.select_from(AppBadgeRules), :badges
@@ -36,8 +36,7 @@ module Merit
36
36
  end
37
37
  end
38
38
 
39
- # Mark merit_action as processed
40
- def processed!
39
+ def mark_as_processed!
41
40
  self.processed = true
42
41
  save
43
42
  end
@@ -13,8 +13,8 @@ module Merit
13
13
  include Merit::PointRulesMethods
14
14
 
15
15
  def initialize
16
- # score 10, :on => 'users#update' do
17
- # user.name.present?
16
+ # score 10, :on => 'users#create' do |user|
17
+ # user.bio.present?
18
18
  # end
19
19
  #
20
20
  # score 15, :on => 'reviews#create', :to => [:reviewer, :reviewed]
@@ -23,6 +23,8 @@ module Merit
23
23
  # 'comments#create',
24
24
  # 'photos#create'
25
25
  # ]
26
+ #
27
+ # score -10, :on => 'comments#destroy'
26
28
  end
27
29
  end
28
30
  end
@@ -49,7 +49,8 @@ module Merit
49
49
  # http://blog.hasmanythrough.com/2012/1/20/modularized-association-methods-in-rails-3-2
50
50
  def _merit_sash_initializer
51
51
  define_method(:_sash) do
52
- sash || update_attributes(sash: Sash.create)
52
+ # TODO: reload.sash is not regression tested
53
+ sash || reload.sash || update_attributes(sash: Sash.create)
53
54
  sash
54
55
  end
55
56
  end
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.homepage = "http://github.com/tute/merit"
6
6
  s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
7
7
  s.license = 'MIT'
8
- s.version = '2.3.0'
8
+ s.version = '2.3.1'
9
9
  s.authors = ["Tute Costa"]
10
10
  s.email = 'tutecosta@gmail.com'
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tute Costa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2015-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ambry
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  version: '0'
281
281
  requirements: []
282
282
  rubyforge_project:
283
- rubygems_version: 2.2.2
283
+ rubygems_version: 2.4.5
284
284
  signing_key:
285
285
  specification_version: 4
286
286
  summary: General reputation Rails engine.