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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjUzMTAyNGMyZGE1ODg0OGE3MzM0ZDQwNGNmOTg1OWE2NjU1MjBhMA==
4
+ ZWJkNjhjOWRjM2FkMWRlZjBiNDc0YWNmNTQ0YjQ0ZjZlMzVlZmI2Zg==
5
5
  data.tar.gz: !binary |-
6
- ZGJiNThhMDcwM2VmNWFjYzg2Y2I0Y2ZiMGFmOTJhOWQxYTgyYWRhYw==
6
+ NmE2ZjEwYWIxNDFjNmE3YzRhOTEyZDE0ZTI4Zjk2OTQwMDJjZTRmZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTdlZTM4NTFiNjU5YjI2NDg3MGRlMDY3MDhkMTgyOWExYjQxMzljYWE5NGFm
10
- ZGJhMmY2MTgzNWQ4ZmM2OWJhYjFhOTNjZmE0NWIxYjVjNmFmNDE4ZmU5NGFh
11
- NzJiYzliMzQ0YzEzMmE2ODdhYTE3MmU1NzE1ZWIwNmNhMDA3YjY=
9
+ M2Y5ZDUxNzAyODg1ODVlZjllODBjM2M5OTY5MWQzMWE3ZWQxZTNiMzA5MWJk
10
+ ZGFlYWU2Y2RlMjQ4NTRjODE4MzBmNTVjN2I3NjVkYWRiYjcyMzE3OWVkYTZh
11
+ NWFlZjViMTAzODgyMDFjZTZiMWFkM2ZhYzI1ZWNkZmJhMDQzMjI=
12
12
  data.tar.gz: !binary |-
13
- NjFhZDUzZTgyZWVlNmU4NjMwZjk4OTdhMmNkYjdlMmJmYTk4YWRkZGRkNWJk
14
- NDgxNzUyYmI5MDEzZjJlOTc1NWQ0M2ZkNWNiYTE1YzIwNDc3MWIwMjcwNDA5
15
- NGY1NzA5MDg0NjljYzM3ZjA4NjAxNDMwZTFjZGVjZjhlNWUxNmY=
13
+ YmI5YjIwNmU5NmE4ZTAyOTVjMTgxOTU3YWJkZDU5NDFmYjUzMDkxYTcyZWNm
14
+ NTRhMjNmOGYzM2VhOGE3YTQ2N2EzY2EzOGRlYTBmNDY5ZmE3MTU0YzAwMDgw
15
+ OTQwY2VjZDFkZjIxMzA0ZTU1YjE2OGY4MWMzYmNmOGJhMzNiY2E=
@@ -6,7 +6,8 @@ module Popular
6
6
  belongs_to :friend, polymorphic: true
7
7
  has_one :friendship_profile
8
8
 
9
- validates_uniqueness_of :friend_id, scope: :popular_model_id
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
@@ -1,3 +1,3 @@
1
1
  module Popular
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
@@ -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.reload.friendship_profile ).to_not be_nil
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: popular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - thejchap