popular 0.7.2 → 0.7.3
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 +8 -8
- data/lib/popular/friendship.rb +2 -1
- data/lib/popular/version.rb +1 -1
- data/spec/popular/friendship_model_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWJkNjhjOWRjM2FkMWRlZjBiNDc0YWNmNTQ0YjQ0ZjZlMzVlZmI2Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmE2ZjEwYWIxNDFjNmE3YzRhOTEyZDE0ZTI4Zjk2OTQwMDJjZTRmZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2Y5ZDUxNzAyODg1ODVlZjllODBjM2M5OTY5MWQzMWE3ZWQxZTNiMzA5MWJk
|
10
|
+
ZGFlYWU2Y2RlMjQ4NTRjODE4MzBmNTVjN2I3NjVkYWRiYjcyMzE3OWVkYTZh
|
11
|
+
NWFlZjViMTAzODgyMDFjZTZiMWFkM2ZhYzI1ZWNkZmJhMDQzMjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmI5YjIwNmU5NmE4ZTAyOTVjMTgxOTU3YWJkZDU5NDFmYjUzMDkxYTcyZWNm
|
14
|
+
NTRhMjNmOGYzM2VhOGE3YTQ2N2EzY2EzOGRlYTBmNDY5ZmE3MTU0YzAwMDgw
|
15
|
+
OTQwY2VjZDFkZjIxMzA0ZTU1YjE2OGY4MWMzYmNmOGJhMzNiY2E=
|
data/lib/popular/friendship.rb
CHANGED
@@ -6,7 +6,8 @@ module Popular
|
|
6
6
|
belongs_to :friend, polymorphic: true
|
7
7
|
has_one :friendship_profile
|
8
8
|
|
9
|
-
|
9
|
+
validates :friend_id,
|
10
|
+
uniqueness: { scope: [:popular_model_type, :popular_model_id, :friend_type] }
|
10
11
|
validates_presence_of :friend, :popular_model
|
11
12
|
|
12
13
|
# Ensures that popular_models cannot add themselves as a friend
|
data/lib/popular/version.rb
CHANGED
@@ -4,7 +4,7 @@ shared_examples 'a friendship model' do
|
|
4
4
|
it 'allows for a one-to-one mapping between friendship and a friendship_profile' do
|
5
5
|
friendship = custom_popular_model.befriend another_custom_popular_model
|
6
6
|
|
7
|
-
expect( friendship.
|
7
|
+
expect( friendship.friendship_profile ).to_not be_nil
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'model does not get created unless explicitly opted in' do
|