merit 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c2cb7b1562ee27518561243969673e6bc9796f4
4
- data.tar.gz: ac96051e01a3ad6223ebc0a84ffa7d0f7845dc67
3
+ metadata.gz: f485a4853da5aa06c851c133b85206b798755c41
4
+ data.tar.gz: c148037a475f47d09b9a774da2fc8669ec016212
5
5
  SHA512:
6
- metadata.gz: 74b144eb96c51f83aacb529ac9d87962e9fed9e48f6af0da365b00df773597c28f79a66f8ab3048df3c9042a62e46371442661123b4321f0a9d333fa8f97ed67
7
- data.tar.gz: 1022b3357c719d183dfa1b2b068943fecefa009263aeed1905d051310c29e644333c087cadbd5eec433d0542a11abf5174121c38f003d6b657e937895345ca44
6
+ metadata.gz: e43c8bb0a86b3d57adfeaa8816d566a8e9d4705d75a9ac926ce5e6dcc9c27eb1fd96bd145c353818275ea241a91475c9d3a7700f0d35d28532b1f54b794864c0
7
+ data.tar.gz: 5f137da4113ebfb20f398fd733aa0b65285a3a8f6aa9758dae9536d13bab161fb2bef80da3d492468564cbaa9a933143343146b3dcd4f7d369a6022a6535cb44
data/NEWS.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  User-visible changes worth mentioning.
4
4
 
5
+ ## 3.0.1
6
+
7
+ - [#282] Run action controller load hook only once
8
+ - [#284] Add migration version to active record migrations
9
+ - Add RELEASING.md document
10
+
5
11
  ## 3.0.0
6
12
 
7
13
  - [#276] Drops Rails <5 version support. Drops deprecated `action_filter` call.
@@ -0,0 +1,16 @@
1
+ # Releasing
2
+
3
+ 1. Update `NEWS.md` to reflect the changes since last release.
4
+ 1. Tag the release: `git tag vVERSION -a -s`. The tag message should contain the
5
+ appropriate `NEWS.md` subsection.
6
+ 1. Push changes: `git push --tags`
7
+ 1. Build and publish to rubygems:
8
+ ```bash
9
+ gem build merit.gemspec
10
+ gem push merit-*.gem
11
+ ```
12
+
13
+ 1. Add a new GitHub release:
14
+ https://github.com/merit-gem/merit/releases/new?tag=vVERSION
15
+ 1. Announce the new release, making sure to say "thank you" to the contributors
16
+ who helped shape this version!
@@ -28,6 +28,10 @@ module ActiveRecord
28
28
  migration_template 'create_scores_and_points.rb',
29
29
  'db/migrate/create_scores_and_points.rb'
30
30
  end
31
+
32
+ def migration_version
33
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
34
+ end
31
35
  end
32
36
  end
33
37
  end
@@ -16,6 +16,10 @@ module ActiveRecord
16
16
  migration_template 'add_merit_fields_to_model.rb',
17
17
  "db/migrate/add_merit_fields_to_#{table_name}.rb"
18
18
  end
19
+
20
+ def migration_version
21
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -21,6 +21,10 @@ module ActiveRecord
21
21
  "db/migrate/remove_merit_fields_from_#{table_name}.rb"
22
22
  )
23
23
  end
24
+
25
+ def migration_version
26
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -1,4 +1,4 @@
1
- class AddMeritFieldsTo<%= table_name.camelize %> < ActiveRecord::Migration
1
+ class AddMeritFieldsTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  add_column :<%= table_name %>, :sash_id, :integer
4
4
  add_column :<%= table_name %>, :level, :integer, :default => 0
@@ -1,4 +1,4 @@
1
- class AddTargetDataToMeritActions < ActiveRecord::Migration
1
+ class AddTargetDataToMeritActions < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  add_column :merit_actions, :target_data, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateBadgesSashes < ActiveRecord::Migration
1
+ class CreateBadgesSashes < ActiveRecord::Migration<%= migration_version %>
2
2
  def self.up
3
3
  create_table :badges_sashes do |t|
4
4
  t.integer :badge_id, :sash_id
@@ -1,4 +1,4 @@
1
- class CreateMeritActions < ActiveRecord::Migration
1
+ class CreateMeritActions < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :merit_actions do |t|
4
4
  t.integer :user_id
@@ -1,4 +1,4 @@
1
- class CreateMeritActivityLogs < ActiveRecord::Migration
1
+ class CreateMeritActivityLogs < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :merit_activity_logs do |t|
4
4
  t.integer :action_id
@@ -1,4 +1,4 @@
1
- class CreateSashes < ActiveRecord::Migration
1
+ class CreateSashes < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :sashes do |t|
4
4
  t.timestamps null: false
@@ -1,4 +1,4 @@
1
- class CreateScoresAndPoints < ActiveRecord::Migration
1
+ class CreateScoresAndPoints < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :merit_scores do |t|
4
4
  t.references :sash
@@ -1,4 +1,4 @@
1
- class RemoveMeritFieldsFrom<%= table_name.camelize %> < ActiveRecord::Migration
1
+ class RemoveMeritFieldsFrom<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def self.up
3
3
  remove_column :<%= table_name %>, :sash_id
4
4
  remove_column :<%= table_name %>, :level
@@ -1,4 +1,4 @@
1
- class RemoveMeritTables < ActiveRecord::Migration
1
+ class RemoveMeritTables < ActiveRecord::Migration<%= migration_version %>
2
2
  def self.up
3
3
  drop_table :merit_actions
4
4
  drop_table :merit_activity_logs
@@ -19,6 +19,10 @@ module ActiveRecord
19
19
  end
20
20
  end
21
21
 
22
+ def migration_version
23
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
24
+ end
25
+
22
26
  private
23
27
 
24
28
  def target_data_column_doesnt_exist?
@@ -82,7 +82,7 @@ module Merit
82
82
  initializer 'merit.controller' do |app|
83
83
  extend_orm_with_has_merit
84
84
  require_models
85
- ActiveSupport.on_load(:action_controller) do
85
+ ActiveSupport.on_load(:action_controller, run_once: true) do
86
86
  begin
87
87
  # Load app rules on boot up
88
88
  Merit::AppBadgeRules = Merit::BadgeRules.new.defined_rules
@@ -6,7 +6,7 @@ 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 = '3.0.0'
9
+ s.version = '3.0.1'
10
10
  s.authors = ["Tute Costa"]
11
11
  s.email = 'tutecosta@gmail.com'
12
12
 
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: 3.0.0
4
+ version: 3.0.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: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2018-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ambry
@@ -119,6 +119,7 @@ files:
119
119
  - MIT-LICENSE
120
120
  - NEWS.md
121
121
  - README.md
122
+ - RELEASING.md
122
123
  - Rakefile
123
124
  - TESTING.txt
124
125
  - UPGRADING.md
@@ -281,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
282
  version: '0'
282
283
  requirements: []
283
284
  rubyforge_project:
284
- rubygems_version: 2.6.11
285
+ rubygems_version: 2.6.13
285
286
  signing_key:
286
287
  specification_version: 4
287
288
  summary: Reputation engine for Rails apps