amistad 0.10.1 → 0.10.2

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
  SHA1:
3
- metadata.gz: f50e0deb3b3780d566b3f87b9c231b31a204fa12
4
- data.tar.gz: 6a67c57e4a335a248f9d205400a42041b71296e2
3
+ metadata.gz: aaaa2fddb20b9484faeb8efb2915055bb33d63ea
4
+ data.tar.gz: e09283b1a63c21c22fba1231cfc9bcb7f57e9d73
5
5
  SHA512:
6
- metadata.gz: 15550b7dc044f530c06af839736bda248895fd6f1e252f3bc3d2eceb6b6e616d91e06843f189b7be6a7ea55aa54db37dd39b4c33134e5d84b5d2c1ca8b7561ef
7
- data.tar.gz: 685977b29742d67f9e82ec1e2cd6064203f70807ee4570f4142600f211c8e07f7a8995e2cfbf64214e86b3bb5573044672c7a46688b7ea9e16a62fb250b6dd68
6
+ metadata.gz: a955343572bda74bae2314f3d03b5f7948ec205fbcedd1144f69c35be3267fe7fedb5e089fa7246b05121c5a6382f8c63eba23e97d41f49dbfc004eccfb1476b
7
+ data.tar.gz: 46d4de03c839fb7da3ee1db399d9c63f47542fa8623f7ee0d43a4b225db5f1da42d898dd1c46743c0775aea2b10d2e02293aa44b622d85870a50c554c5e50a74
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- amistad (0.10.1)
4
+ amistad (0.10.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -62,10 +62,10 @@ module Amistad
62
62
  def friends
63
63
  friendship_model = Amistad::Friendships.const_get(:"#{Amistad.friendship_model}")
64
64
 
65
- approved_friendship_ids = friendship_model.where(friendable_id: id, pending: false, blocker_id: nil).select(:friend_id).map(&:friend_id)
66
- approved_inverse_friendship_ids = friendship_model.where(friend_id: id, pending: false, blocker_id: nil).select(:friendable_id).map(&:friendable_id)
65
+ approved_friendship = friendship_model.where(friendable_id: id, pending: false, blocker_id: nil).select(:friend_id).to_sql
66
+ approved_inverse_friendship = friendship_model.where(friend_id: id, pending: false, blocker_id: nil).select(:friendable_id).to_sql
67
67
 
68
- self.class.where(id: approved_friendship_ids + approved_inverse_friendship_ids)
68
+ self.class.where("id in (#{approved_friendship}) OR id in (#{approved_inverse_friendship})")
69
69
  end
70
70
 
71
71
  # total # of invited and invited_by without association loading
@@ -1,3 +1,3 @@
1
1
  module Amistad
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amistad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rawane ZOSSOU
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-15 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler