kudos 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: ebb7e489ed4526e9167779847225e408094b13bbc0eeb8d9886e91d3dc183fda
4
- data.tar.gz: b1ff458db038d7572f2f930c863f43c2c397efd8abb61204c374db406a97f52c
3
+ metadata.gz: ea38b07642513a07024bb3d536cb36bfb8d8f4b7911297604a7384c17d9f4ea5
4
+ data.tar.gz: e3cd8d9dc9e2bd892f9a2c58cdce8199a1bd0fd7fde2c0f125c8320ae1cdd321
5
5
  SHA512:
6
- metadata.gz: 0f0d8e9b3d5d208842c15e2ab726102fa0616e8e1efdfc294444d0001888fa7d17b97da7f252e1c787af3336c7c5b781c195fdb215bbc7a038e8490a50aecfec
7
- data.tar.gz: bb59a485c713ca0b9d46fbe3037ae52afc97199dcf91858f5650e7fa07e0e871f092e437a900e2691db63040e52a04e7a1b53479f657ff6e302d00965b9fdf4b
6
+ metadata.gz: 29635885d33237c006255763d474e7c988ee7b9bc3a689310571c32bba101638b94b56f58bc73636ebbe637dc7217f17d3a1cc6d2a829a16c76f2d8f5efe5a3c
7
+ data.tar.gz: 43425c72b9f2ce96cf03b54b4653bed9fd6a7a5c9fa3e9ed38cdf15901391dee5e53fd74b9fd77b4e78b46394d0334921ad9ff8f3cd4b83055372ccc8d2ca695
@@ -22,5 +22,9 @@ module Kudos
22
22
  class_name: 'Kudos::Achievement',
23
23
  foreign_key: :kudos_achievement_group_id,
24
24
  dependent: :destroy
25
+
26
+ def with_children_groups
27
+ children.flat_map(&:with_children_groups).push(id)
28
+ end
25
29
  end
26
30
  end
@@ -22,5 +22,9 @@ module Kudos
22
22
  class_name: 'Kudos::Achievement',
23
23
  foreign_key: :kudos_achievement_group_id,
24
24
  dependent: :destroy
25
+
26
+ def with_children_groups
27
+ children.flat_map(&:with_children_groups).push(id)
28
+ end
25
29
  end
26
30
  end
@@ -23,7 +23,7 @@ class CreateKudosTables < ActiveRecord::Migration<%= migration_version %>
23
23
  end
24
24
 
25
25
  create_table :kudos_<%= @user_model_name %>s_achievements do |t|
26
- t.references :<%= @user_model_name %>, null: false, foreign_key: true
26
+ t.bigint :<%= @user_model_name %>_id, null: false
27
27
  t.references :kudos_achievement, null: false, foreign_key: true
28
28
  t.boolean :notified, null: false, default: false
29
29
  t.integer :rank
@@ -32,6 +32,7 @@ class CreateKudosTables < ActiveRecord::Migration<%= migration_version %>
32
32
  t.jsonb :description, null: false, default: {}
33
33
  t.timestamps
34
34
  end
35
+
35
36
  add_index :kudos_users_achievements, [:<%= @user_model_name %>_id, :kudos_achievement_id], unique: true, name: 'kudos_users_achievements_unique_index'
36
37
  end
37
38
 
data/lib/kudos/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kudos
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kudos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-01 00:00:00.000000000 Z
11
+ date: 2023-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails