has_friendship 1.1.3 → 1.1.5

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: 227f53cc04f4a9112f9c00c718ef0b5b94d594db9880aabc724a59f19e3ca53d
4
- data.tar.gz: 2ed9c242a90308842bc1297df5cc868502b5d37713af9f6b89fa6ebba1a5b278
3
+ metadata.gz: 8e7405f12ea84e279cc43435c42a147f26564beeed2d42491b9ed46d6b1c0251
4
+ data.tar.gz: 9f4519f3ef0253f739a46f2fa2efc0a806ceb320de89eb654a739eb3139c839c
5
5
  SHA512:
6
- metadata.gz: a9875987ef55fcc4d146b8364ce3009f6df5d3c2f1cf4f4d9f069b845673c1037e75620db5e1064276511d950cf6700ffde5e11efce5b5649d47699a5f3d9904
7
- data.tar.gz: 0b44c5878aded4760f54bc7903b093baa3bb0eecf189f6d5667bc123306ada2e4ae402be0d9309002b600420f64753876a73bba0236a0025306bf70f2a750050
6
+ metadata.gz: 7d04acf4d3f0f4a9450a40b6edcefa2b89267e275a2da11ed94c5c39a0743bd98fceb4dd28afab0fa915d74a00f671a9b3570cf21b9bd45caca998bd70014a92
7
+ data.tar.gz: 7da05c876ed87d065940447da83e84810db4e5f7ce904ff0548575e34c483e607b3f23b0d2dbd855e576d0427735a9be804de0a4c3f043898d2ac3e2759b1a5c
@@ -0,0 +1,19 @@
1
+ if ActiveRecord.gem_version >= Gem::Version.new('5.0')
2
+ class AddUniqueIndexToFriendships < ActiveRecord::Migration[4.2]; end
3
+ else
4
+ class AddUniqueIndexToFriendships < ActiveRecord::Migration; end
5
+ end
6
+
7
+ AddUniqueIndexToFriendships.class_eval do
8
+ disable_ddl_transaction!
9
+
10
+ def self.up
11
+ return if index_exists?(:friendships, [:friendable_id, :friend_id])
12
+
13
+ add_index :friendships, [:friendable_id, :friend_id], unique: true, algorithm: :concurrently
14
+ end
15
+
16
+ def self.down
17
+ remove_index :friendships, [:friendable_id, :friend_id]
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module HasFriendship
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_friendship
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sung Won Cho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-02 00:00:00.000000000 Z
11
+ date: 2018-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -168,6 +168,7 @@ files:
168
168
  - db/migrate/1_create_friendships.rb
169
169
  - db/migrate/2_add_blocker_id_to_friendships.rb
170
170
  - db/migrate/3_update_friendships.rb
171
+ - db/migrate/4_add_unique_index_to_friendships.rb
171
172
  - lib/has_friendship.rb
172
173
  - lib/has_friendship/engine.rb
173
174
  - lib/has_friendship/extender.rb