has_friends_ti2 0.0.22 → 0.0.23

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 097ffae0ab0f59a935d09428c7d045aeb4da24e8
4
- data.tar.gz: 4ffde702a150b4dcef50079293719bb6c6f93450
3
+ metadata.gz: 389eb6486b904c492293fa6aa209347d677063e6
4
+ data.tar.gz: 6d2f482e5675ba004e4185d92ef5d331f3bc211e
5
5
  SHA512:
6
- metadata.gz: d67263d8d8c742a9d6da53c9e7eac92875f57d313c6b00bb929ce97ec02351853d354bd6097a85f850a77f12039af57e83670a0dbc76b598c22b7692bb53cd92
7
- data.tar.gz: 2203974ac10a80eb829d175565823c3aa61e13fc593ecb3d827de53b35a9129f0ff43d1b73fe8b1148df308e957987b85860d4447cf2a7f9ef27b7d78081c24f
6
+ metadata.gz: c11bbf6724dea616054680cf6445431cad5f6485948e481ec14835b929a0b3e6c1a3f402b495b760eeefc3993aaaf7254b0001979ca6a17c3ea110be61430ea8
7
+ data.tar.gz: 6d40febbcfc214836431a44b69e2b20ac7d3cdefb6d4a24b0e0ebdeea53388f375a5fa596038dad4b0d7c80e4c93dc90796660227cdb87ce9c5ca7daa85987bf
@@ -1,14 +1,18 @@
1
1
  module HasFriends
2
2
 
3
3
  module Friends
4
+ def self.included(receiver)
5
+ receiver.extend HasFriends::Friends::ClassMethods
6
+ end
4
7
  module ClassMethods
5
8
  def has_friends
9
+ include HasFriends::Friends::InstanceMethods
6
10
  has_many :friendships
7
11
  has_many :friends, :through => :friendships, :source => :friend#,-> { where( status: 'accepted')} #"friendships.status = 'accepted'"
8
12
  after_destroy :destroy_all_friendships
9
13
  end
10
14
  end
11
-
15
+
12
16
  module InstanceMethods
13
17
  def be_friends_with friend
14
18
  # no user object
@@ -66,11 +70,6 @@ module HasFriends
66
70
  Friendship.delete_all({:friend_id => id})
67
71
  end
68
72
  end
69
-
70
- def self.included(receiver)
71
- receiver.extend HasFriends::Friends::ClassMethods
72
- receiver.send :include, HasFriends::Friends::InstanceMethods
73
- end
74
73
  end
75
74
 
76
- end
75
+ end
@@ -1,3 +1,3 @@
1
1
  module HasFriends
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_friends_ti2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago D Cipriano