merit 2.4.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -18
- data/NEWS.md +5 -0
- data/README.md +1 -1
- data/lib/generators/active_record/templates/create_merit_actions.rb +1 -1
- data/lib/generators/active_record/templates/create_sashes.rb +1 -1
- data/lib/merit/controller_extensions.rb +9 -8
- data/merit.gemspec +4 -4
- data/test/dummy/config/environments/test.rb +1 -1
- data/test/dummy/db/migrate/20110421191249_create_users.rb +2 -2
- data/test/dummy/db/migrate/20110421191250_create_comments.rb +2 -2
- data/test/dummy/db/migrate/20120318022220_add_fields_to_users.rb +1 -1
- data/test/dummy/db/migrate/20130321082817_add_fields_to_comments.rb +1 -1
- data/test/dummy/db/migrate/20130329224406_create_merit_actions.rb +2 -2
- data/test/dummy/db/migrate/20130329224407_create_merit_activity_logs.rb +1 -1
- data/test/dummy/db/migrate/20130329224408_create_sashes.rb +2 -2
- data/test/dummy/db/migrate/20130329224409_create_badges_sashes.rb +1 -1
- data/test/dummy/db/migrate/20130329224410_create_scores_and_points.rb +1 -1
- data/test/dummy/db/migrate/20140211144001_create_addresses.rb +1 -1
- data/test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb +1 -1
- data/test/dummy/db/migrate/20140906225844_create_players.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c2cb7b1562ee27518561243969673e6bc9796f4
|
4
|
+
data.tar.gz: ac96051e01a3ad6223ebc0a84ffa7d0f7845dc67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74b144eb96c51f83aacb529ac9d87962e9fed9e48f6af0da365b00df773597c28f79a66f8ab3048df3c9042a62e46371442661123b4321f0a9d333fa8f97ed67
|
7
|
+
data.tar.gz: 1022b3357c719d183dfa1b2b068943fecefa009263aeed1905d051310c29e644333c087cadbd5eec433d0542a11abf5174121c38f003d6b657e937895345ca44
|
data/Gemfile
CHANGED
@@ -2,23 +2,8 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
version = ENV['RAILS_VERSION'] || '
|
6
|
-
rails
|
7
|
-
when 'master'
|
8
|
-
{ github: 'rails/rails' }
|
9
|
-
when '4.0-protected-attributes'
|
10
|
-
gem 'protected_attributes'
|
11
|
-
"~> 4.0.0"
|
12
|
-
when /4\.0|4\.1/
|
13
|
-
"~> #{version}.0"
|
14
|
-
when /4\.2/
|
15
|
-
"~> #{version}.0.rc3"
|
16
|
-
when '3.2'
|
17
|
-
gem 'strong_parameters'
|
18
|
-
"~> #{version}.0"
|
19
|
-
end
|
20
|
-
|
21
|
-
gem 'rails', rails
|
5
|
+
version = ENV['RAILS_VERSION'] || '5.0.3'
|
6
|
+
gem 'rails', version
|
22
7
|
|
23
8
|
case ENV['ORM']
|
24
9
|
when 'active_record'
|
@@ -36,7 +21,7 @@ platforms :rbx do
|
|
36
21
|
gem 'rubysl', '~> 2.0'
|
37
22
|
gem 'psych'
|
38
23
|
gem 'racc'
|
39
|
-
gem 'minitest'
|
24
|
+
gem 'minitest', '~> 5.10', '!= 5.10.2'
|
40
25
|
gem 'rubinius-developer_tools'
|
41
26
|
end
|
42
27
|
|
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Merit adds reputation behavior to Rails apps in the form of Badges, Points,
|
|
4
4
|
and Rankings.
|
5
5
|
|
6
6
|
[![Build Status](https://travis-ci.org/merit-gem/merit.svg?branch=master)](http://travis-ci.org/merit-gem/merit)
|
7
|
-
[![Coverage Status](https://
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/github/merit-gem/merit/badge.svg?branch=master)](https://coveralls.io/github/merit-gem/merit?branch=master)
|
8
8
|
[![Code Climate](https://codeclimate.com/github/tute/merit/badges/gpa.svg)](https://codeclimate.com/github/tute/merit)
|
9
9
|
|
10
10
|
# Table of Contents
|
@@ -4,18 +4,19 @@ module Merit
|
|
4
4
|
# 'controller_path#action_name'
|
5
5
|
module ControllerExtensions
|
6
6
|
def self.included(base)
|
7
|
-
base.
|
8
|
-
if rules_defined?
|
9
|
-
log_merit_action
|
10
|
-
Merit::Action.check_unprocessed if Merit.checks_on_each_request
|
11
|
-
end
|
12
|
-
end
|
7
|
+
base.after_action :log_and_process
|
13
8
|
end
|
14
9
|
|
15
10
|
private
|
16
11
|
|
17
|
-
def
|
18
|
-
|
12
|
+
def log_and_process
|
13
|
+
if rules_defined?
|
14
|
+
Merit::Action.create(merit_action_hash)
|
15
|
+
|
16
|
+
if Merit.checks_on_each_request
|
17
|
+
Merit::Action.check_unprocessed
|
18
|
+
end
|
19
|
+
end
|
19
20
|
end
|
20
21
|
|
21
22
|
def merit_action_hash
|
data/merit.gemspec
CHANGED
@@ -6,14 +6,14 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
|
7
7
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
8
8
|
s.license = 'MIT'
|
9
|
-
s.version = '
|
9
|
+
s.version = '3.0.0'
|
10
10
|
s.authors = ["Tute Costa"]
|
11
11
|
s.email = 'tutecosta@gmail.com'
|
12
12
|
|
13
|
-
s.required_ruby_version = '>=
|
13
|
+
s.required_ruby_version = '>= 2.2.2'
|
14
14
|
|
15
|
-
s.add_dependency 'ambry',
|
16
|
-
s.add_development_dependency 'rails', '>=
|
15
|
+
s.add_dependency 'ambry', '~> 1.0.0'
|
16
|
+
s.add_development_dependency 'rails', '>= 5.0.0'
|
17
17
|
s.add_development_dependency 'capybara'
|
18
18
|
s.add_development_dependency 'simplecov'
|
19
19
|
s.add_development_dependency 'rubocop'
|
@@ -32,5 +32,5 @@ Dummy::Application.configure do
|
|
32
32
|
# Print deprecation notices to the stderr
|
33
33
|
config.active_support.deprecation = :stderr
|
34
34
|
|
35
|
-
config.eager_load =
|
35
|
+
config.eager_load = false
|
36
36
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateComments < ActiveRecord::Migration
|
1
|
+
class CreateComments < ActiveRecord::Migration[5.0]
|
2
2
|
def self.up
|
3
3
|
create_table :comments do |t|
|
4
4
|
t.string :name
|
@@ -6,7 +6,7 @@ class CreateComments < ActiveRecord::Migration
|
|
6
6
|
t.integer :user_id
|
7
7
|
t.integer :votes, :default => 0
|
8
8
|
|
9
|
-
t.timestamps
|
9
|
+
t.timestamps null: false
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateMeritActions < ActiveRecord::Migration
|
1
|
+
class CreateMeritActions < ActiveRecord::Migration[5.0]
|
2
2
|
def self.up
|
3
3
|
create_table :merit_actions do |t|
|
4
4
|
t.integer :user_id # source
|
@@ -8,7 +8,7 @@ class CreateMeritActions < ActiveRecord::Migration
|
|
8
8
|
t.string :target_model
|
9
9
|
t.integer :target_id
|
10
10
|
t.boolean :processed, :default => false
|
11
|
-
t.timestamps
|
11
|
+
t.timestamps null: false
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
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:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tute Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ambry
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 5.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 5.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: capybara
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,7 +273,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
273
273
|
requirements:
|
274
274
|
- - ">="
|
275
275
|
- !ruby/object:Gem::Version
|
276
|
-
version:
|
276
|
+
version: 2.2.2
|
277
277
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
278
278
|
requirements:
|
279
279
|
- - ">="
|
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
281
|
version: '0'
|
282
282
|
requirements: []
|
283
283
|
rubyforge_project:
|
284
|
-
rubygems_version: 2.
|
284
|
+
rubygems_version: 2.6.11
|
285
285
|
signing_key:
|
286
286
|
specification_version: 4
|
287
287
|
summary: Reputation engine for Rails apps
|