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 +4 -4
- data/db/migrate/4_add_unique_index_to_friendships.rb +19 -0
- data/lib/has_friendship/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e7405f12ea84e279cc43435c42a147f26564beeed2d42491b9ed46d6b1c0251
|
4
|
+
data.tar.gz: 9f4519f3ef0253f739a46f2fa2efc0a806ceb320de89eb654a739eb3139c839c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|
+
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
|