spree_api 4.0.1 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spree_api might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 657f3332e7148e72662a194f2eb787e6bbda1c9922dbe65129a96485f7f69a2e
4
- data.tar.gz: ecdc2349510f27a8a6f8cb32f05312bcc008106a2f14143134be798219204d73
3
+ metadata.gz: 7c0e5548a962fc184efb5acee56e3349d2280f77ee6f3cec4cf96f57f1ca6790
4
+ data.tar.gz: 7179cfd1aa74207e58e54e8b6aff45110ece30b043a3d9ee57e5bc0ad31fe15b
5
5
  SHA512:
6
- metadata.gz: b1ccb91078e63ce0d23c70c6899a93f23133837ff0e8048370d1875a6d2a1b4cfc58dcdd91486a0577e79a34af915841b107f10f44cd29bdb94365b93f59f525
7
- data.tar.gz: ad53d5078987578b62a81fea20314abd5d0c490d2ebe96d3ca5135a3a91a2f432f9f19fa25037a23880cb0982055b863b2bd613b7f2581896d1846e49f611bbf
6
+ metadata.gz: 39b32f8a83d3cad4028f6719adb391ab5b710b7049735aef350823f88116e373ba657880726c38e26f12860aaa6d850aa7a42f004b556acdf4c9bc5b45c92bca
7
+ data.tar.gz: 1086592c64ae7bbb78188e2db63295c021d5ce3f389ee79ee86cda9b50b1c8b9b7e36e67afed01f2e7463f3a920a263b999fb5dbacd297852d58640c90e42fb1
@@ -7,13 +7,17 @@ module Spree
7
7
  def index
8
8
  @users = Spree.user_class.accessible_by(current_ability, :show)
9
9
 
10
- @users = if params[:ids]
11
- @users.ransack(id_in: params[:ids].split(','))
12
- else
13
- @users.ransack(params[:q])
14
- end
10
+ if params[:ids]
11
+ @users = @users.where(id: params[:ids])
12
+ elsif params[:q]
13
+ users_with_ship_address = @users.with_address(params[:q][:ship_address_firstname_start])
14
+ users_with_bill_address = @users.with_address(params[:q][:ship_address_firstname_start], :bill_address)
15
15
 
16
- @users = @users.result.page(params[:page]).per(params[:per_page])
16
+ users_with_addresses_ids = (users_with_ship_address.ids + users_with_bill_address.ids).compact.uniq
17
+ @users = @users.with_email_or_addresses_ids(params[:q][:email_start], users_with_addresses_ids)
18
+ end
19
+
20
+ @users = @users.page(params[:page]).per(params[:per_page])
17
21
  expires_in 15.minutes, public: true
18
22
  headers['Surrogate-Control'] = "max-age=#{15.minutes}"
19
23
  respond_with(@users)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-29 00:00:00.000000000 Z
11
+ date: 2019-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-rspec
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.0.1
33
+ version: 4.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.0.1
40
+ version: 4.0.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rabl
43
43
  requirement: !ruby/object:Gem::Requirement