spree_api 3.1.14 → 3.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/app/controllers/spree/api/base_controller.rb +2 -2
  4. data/app/controllers/spree/api/v1/addresses_controller.rb +1 -1
  5. data/app/controllers/spree/api/v1/classifications_controller.rb +1 -1
  6. data/app/controllers/spree/api/v1/images_controller.rb +3 -0
  7. data/app/controllers/spree/api/v1/inventory_units_controller.rb +3 -3
  8. data/app/controllers/spree/api/v1/line_items_controller.rb +3 -0
  9. data/app/controllers/spree/api/v1/option_types_controller.rb +16 -7
  10. data/app/controllers/spree/api/v1/option_values_controller.rb +6 -3
  11. data/app/controllers/spree/api/v1/orders_controller.rb +13 -24
  12. data/app/controllers/spree/api/v1/payments_controller.rb +0 -1
  13. data/app/controllers/spree/api/v1/products_controller.rb +8 -5
  14. data/app/controllers/spree/api/v1/stock_items_controller.rb +1 -1
  15. data/app/controllers/spree/api/v1/stock_locations_controller.rb +1 -1
  16. data/app/controllers/spree/api/v1/tags_controller.rb +28 -0
  17. data/app/controllers/spree/api/v1/taxonomies_controller.rb +7 -4
  18. data/app/controllers/spree/api/v1/taxons_controller.rb +4 -1
  19. data/app/controllers/spree/api/v1/users_controller.rb +5 -3
  20. data/app/controllers/spree/api/v1/zones_controller.rb +3 -3
  21. data/app/helpers/spree/api/api_helpers.rb +4 -1
  22. data/app/models/spree/api_configuration.rb +1 -1
  23. data/app/views/spree/api/errors/invalid_api_key.v1.rabl +1 -1
  24. data/app/views/spree/api/errors/invalid_resource.v1.rabl +1 -1
  25. data/app/views/spree/api/errors/must_specify_api_key.v1.rabl +1 -1
  26. data/app/views/spree/api/errors/not_found.v1.rabl +1 -1
  27. data/app/views/spree/api/errors/unauthorized.v1.rabl +1 -1
  28. data/app/views/spree/api/v1/countries/show.v1.rabl +1 -1
  29. data/app/views/spree/api/v1/line_items/show.v1.rabl +2 -2
  30. data/app/views/spree/api/v1/option_types/show.v1.rabl +1 -1
  31. data/app/views/spree/api/v1/orders/invalid_shipping_method.v1.rabl +1 -1
  32. data/app/views/spree/api/v1/orders/payment.v1.rabl +1 -1
  33. data/app/views/spree/api/v1/orders/show.v1.rabl +9 -9
  34. data/app/views/spree/api/v1/payments/credit_over_limit.v1.rabl +1 -1
  35. data/app/views/spree/api/v1/payments/update_forbidden.v1.rabl +1 -1
  36. data/app/views/spree/api/v1/products/show.v1.rabl +5 -5
  37. data/app/views/spree/api/v1/shipments/cannot_ready_shipment.v1.rabl +1 -1
  38. data/app/views/spree/api/v1/shipments/show.v1.rabl +7 -7
  39. data/app/views/spree/api/v1/shipments/small.v1.rabl +8 -8
  40. data/app/views/spree/api/v1/tags/index.v1.rabl +9 -0
  41. data/app/views/spree/api/v1/taxonomies/jstree.rabl +2 -2
  42. data/app/views/spree/api/v1/taxonomies/nested.v1.rabl +2 -2
  43. data/app/views/spree/api/v1/taxons/jstree.rabl +3 -3
  44. data/app/views/spree/api/v1/taxons/show.v1.rabl +1 -1
  45. data/app/views/spree/api/v1/taxons/taxons.v1.rabl +1 -1
  46. data/app/views/spree/api/v1/users/show.v1.rabl +3 -2
  47. data/app/views/spree/api/v1/variants/big.v1.rabl +3 -3
  48. data/app/views/spree/api/v1/variants/small.v1.rabl +3 -2
  49. data/app/views/spree/api/v1/zones/show.v1.rabl +1 -1
  50. data/config/routes.rb +4 -6
  51. data/db/migrate/20100107141738_add_api_key_to_spree_users.rb +2 -2
  52. data/db/migrate/20120411123334_resize_api_key_field.rb +2 -2
  53. data/db/migrate/20120530054546_rename_api_key_to_spree_api_key.rb +1 -1
  54. data/db/migrate/20131017162334_add_index_to_user_spree_api_key.rb +1 -1
  55. data/lib/spree/api/engine.rb +11 -3
  56. data/lib/spree/api/responders/rabl_template.rb +1 -1
  57. data/lib/spree/api/testing_support/caching.rb +2 -2
  58. data/spec/controllers/spree/api/base_controller_spec.rb +96 -0
  59. data/spec/controllers/spree/api/v1/addresses_controller_spec.rb +56 -0
  60. data/spec/controllers/spree/api/v1/checkouts_controller_spec.rb +363 -0
  61. data/spec/controllers/spree/api/v1/classifications_controller_spec.rb +48 -0
  62. data/spec/controllers/spree/api/v1/countries_controller_spec.rb +48 -0
  63. data/spec/controllers/spree/api/v1/credit_cards_controller_spec.rb +80 -0
  64. data/spec/controllers/spree/api/v1/images_controller_spec.rb +114 -0
  65. data/spec/controllers/spree/api/v1/inventory_units_controller_spec.rb +48 -0
  66. data/spec/controllers/spree/api/v1/line_items_controller_spec.rb +203 -0
  67. data/spec/controllers/spree/api/v1/option_types_controller_spec.rb +122 -0
  68. data/spec/controllers/spree/api/v1/option_values_controller_spec.rb +141 -0
  69. data/spec/controllers/spree/api/v1/orders_controller_spec.rb +735 -0
  70. data/spec/controllers/spree/api/v1/payments_controller_spec.rb +234 -0
  71. data/spec/controllers/spree/api/v1/product_properties_controller_spec.rb +147 -0
  72. data/spec/controllers/spree/api/v1/products_controller_spec.rb +409 -0
  73. data/spec/controllers/spree/api/v1/promotion_application_spec.rb +50 -0
  74. data/spec/controllers/spree/api/v1/promotions_controller_spec.rb +64 -0
  75. data/spec/controllers/spree/api/v1/properties_controller_spec.rb +102 -0
  76. data/spec/controllers/spree/api/v1/return_authorizations_controller_spec.rb +161 -0
  77. data/spec/controllers/spree/api/v1/shipments_controller_spec.rb +187 -0
  78. data/spec/controllers/spree/api/v1/states_controller_spec.rb +86 -0
  79. data/spec/controllers/spree/api/v1/stock_items_controller_spec.rb +143 -0
  80. data/spec/controllers/spree/api/v1/stock_locations_controller_spec.rb +113 -0
  81. data/spec/controllers/spree/api/v1/stock_movements_controller_spec.rb +84 -0
  82. data/spec/controllers/spree/api/v1/stores_controller_spec.rb +133 -0
  83. data/spec/controllers/spree/api/v1/tags_controller_spec.rb +102 -0
  84. data/spec/controllers/spree/api/v1/taxonomies_controller_spec.rb +114 -0
  85. data/spec/controllers/spree/api/v1/taxons_controller_spec.rb +177 -0
  86. data/spec/controllers/spree/api/v1/unauthenticated_products_controller_spec.rb +26 -0
  87. data/spec/controllers/spree/api/v1/users_controller_spec.rb +153 -0
  88. data/spec/controllers/spree/api/v1/variants_controller_spec.rb +205 -0
  89. data/spec/controllers/spree/api/v1/zones_controller_spec.rb +91 -0
  90. data/spec/models/spree/legacy_user_spec.rb +19 -0
  91. data/spec/requests/rabl_cache_spec.rb +32 -0
  92. data/spec/requests/ransackable_attributes_spec.rb +79 -0
  93. data/spec/requests/version_spec.rb +19 -0
  94. data/spec/shared_examples/protect_product_actions.rb +17 -0
  95. data/spec/spec_helper.rb +60 -0
  96. data/spec/support/controller_hacks.rb +40 -0
  97. data/spec/support/database_cleaner.rb +14 -0
  98. data/spec/support/have_attributes_matcher.rb +13 -0
  99. data/spree_api.gemspec +7 -4
  100. metadata +99 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d864b52fbae791097fb9bd2441f5ec2d4a7a40e
4
- data.tar.gz: c6c1d1d487b976ccc067a876f504139db298f688
3
+ metadata.gz: 0263d4468e9dfa57da8fde935f0cb2b26fe8d7a0
4
+ data.tar.gz: 903c3bb494e975188c0ef6fa81440c15a8246096
5
5
  SHA512:
6
- metadata.gz: 11e9f491d78600e424e449d7172fcb87d32a6cafa3a956a65713e55ef584d5c3039d58201ec24878aa0153608648e43a2b0baae5318a053fc26160a228bb71ae
7
- data.tar.gz: 801957f1087425cf4b5d478f79beede0062253d2b165b71823eb5c99517e7ae78900a18539ab870e3ea168fd80d99006a35277889404dcbc345b8ce29ac5d8af
6
+ metadata.gz: 5b052fff311b035d3324120f57643106450c26020eb8dcb93afdabea084b9904f2b9f0a18a41f53eb87d4fee50aa980bdc4fce0cfb30015ce066768b089d4edd
7
+ data.tar.gz: 881171f4e20c1a08c6cce5fc8de20d571f8e896645e9d73053429625371b11991bc7fe3f6b3d3ad105160913457030b9e7625251c5ae96e58cf302c7b9d47e91
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  eval(File.read(File.dirname(__FILE__) + '/../common_spree_dependencies.rb'))
2
2
 
3
- gem 'spree_core', :path => '../core'
3
+ gem 'spree_core', path: '../core'
4
+
5
+ gem 'rabl'
4
6
 
5
7
  gemspec
@@ -25,7 +25,7 @@ module Spree
25
25
 
26
26
  def map_nested_attributes_keys(klass, attributes)
27
27
  nested_keys = klass.nested_attributes_options.keys
28
- attributes.inject({}) do |h, (k,v)|
28
+ attributes.to_h.inject({}) do |h, (k,v)|
29
29
  key = nested_keys.include?(k.to_sym) ? "#{k}_attributes" : k
30
30
  h[key] = v
31
31
  h
@@ -89,7 +89,7 @@ module Spree
89
89
  end
90
90
 
91
91
  def unprocessable_entity(message)
92
- render text: { exception: message }.to_json, status: 422
92
+ render plain: { exception: message }.to_json, status: 422
93
93
  end
94
94
 
95
95
  def gateway_error(exception)
@@ -15,7 +15,7 @@ module Spree
15
15
  @address = find_address
16
16
 
17
17
  if @address.update_attributes(address_params)
18
- respond_with(@address, :default_template => :show)
18
+ respond_with(@address, default_template: :show)
19
19
  else
20
20
  invalid_resource!(@address)
21
21
  end
@@ -12,7 +12,7 @@ module Spree
12
12
  # Because position we get back is 0-indexed.
13
13
  # acts_as_list is 1-indexed.
14
14
  classification.insert_at(params[:position].to_i + 1)
15
- render nothing: true
15
+ head :ok
16
16
  end
17
17
  end
18
18
  end
@@ -12,6 +12,9 @@ module Spree
12
12
  respond_with(@image)
13
13
  end
14
14
 
15
+ def new
16
+ end
17
+
15
18
  def create
16
19
  authorize! :create, Image
17
20
  @image = scope.images.new(image_params)
@@ -15,7 +15,7 @@ module Spree
15
15
  inventory_unit.transaction do
16
16
  if inventory_unit.update_attributes(inventory_unit_params)
17
17
  fire
18
- render :show, :status => 200
18
+ render :show, status: 200
19
19
  else
20
20
  invalid_resource!(inventory_unit)
21
21
  end
@@ -35,8 +35,8 @@ module Spree
35
35
 
36
36
  unless inventory_unit.respond_to?(can_event) &&
37
37
  inventory_unit.send(can_event)
38
- render :text => { :exception => "cannot transition to #{@event}" }.to_json,
39
- :status => 200
38
+ render plain: { exception: "cannot transition to #{@event}" }.to_json,
39
+ status: 200
40
40
  false
41
41
  end
42
42
  end
@@ -6,6 +6,9 @@ module Spree
6
6
 
7
7
  self.line_item_options = []
8
8
 
9
+ def new
10
+ end
11
+
9
12
  def create
10
13
  variant = Spree::Variant.find(params[:line_item][:variant_id])
11
14
  @line_item = order.contents.add(
@@ -3,11 +3,17 @@ module Spree
3
3
  module V1
4
4
  class OptionTypesController < Spree::Api::BaseController
5
5
  def index
6
- if params[:ids]
7
- @option_types = Spree::OptionType.includes(:option_values).accessible_by(current_ability, :read).where(id: params[:ids].split(','))
8
- else
9
- @option_types = Spree::OptionType.includes(:option_values).accessible_by(current_ability, :read).load.ransack(params[:q]).result
10
- end
6
+ @option_types = if params[:ids]
7
+ Spree::OptionType.
8
+ includes(:option_values).
9
+ accessible_by(current_ability, :read).
10
+ where(id: params[:ids].split(','))
11
+ else
12
+ Spree::OptionType.
13
+ includes(:option_values).
14
+ accessible_by(current_ability, :read).
15
+ load.ransack(params[:q]).result
16
+ end
11
17
  respond_with(@option_types)
12
18
  end
13
19
 
@@ -16,11 +22,14 @@ module Spree
16
22
  respond_with(@option_type)
17
23
  end
18
24
 
25
+ def new
26
+ end
27
+
19
28
  def create
20
29
  authorize! :create, Spree::OptionType
21
30
  @option_type = Spree::OptionType.new(option_type_params)
22
31
  if @option_type.save
23
- render :show, :status => 201
32
+ render :show, status: 201
24
33
  else
25
34
  invalid_resource!(@option_type)
26
35
  end
@@ -38,7 +47,7 @@ module Spree
38
47
  def destroy
39
48
  @option_type = Spree::OptionType.accessible_by(current_ability, :destroy).find(params[:id])
40
49
  @option_type.destroy
41
- render :text => nil, :status => 204
50
+ render plain: nil, status: 204
42
51
  end
43
52
 
44
53
  private
@@ -4,7 +4,7 @@ module Spree
4
4
  class OptionValuesController < Spree::Api::BaseController
5
5
  def index
6
6
  if params[:ids]
7
- @option_values = scope.where(:id => params[:ids])
7
+ @option_values = scope.where(id: params[:ids])
8
8
  else
9
9
  @option_values = scope.ransack(params[:q]).result.distinct
10
10
  end
@@ -16,11 +16,14 @@ module Spree
16
16
  respond_with(@option_value)
17
17
  end
18
18
 
19
+ def new
20
+ end
21
+
19
22
  def create
20
23
  authorize! :create, Spree::OptionValue
21
24
  @option_value = scope.new(option_value_params)
22
25
  if @option_value.save
23
- render :show, :status => 201
26
+ render :show, status: 201
24
27
  else
25
28
  invalid_resource!(@option_value)
26
29
  end
@@ -38,7 +41,7 @@ module Spree
38
41
  def destroy
39
42
  @option_value = scope.accessible_by(current_ability, :destroy).find(params[:id])
40
43
  @option_value.destroy
41
- render :text => nil, :status => 204
44
+ render plain: nil, status: 204
42
45
  end
43
46
 
44
47
  private
@@ -27,38 +27,27 @@ module Spree
27
27
  end
28
28
 
29
29
  def create
30
- authorize! :create, Spree::Order
31
- if can?(:admin, Spree::Order)
32
-
33
- order_user = if @current_user_roles.include?('admin') && order_params[:user_id]
34
- Spree.user_class.find(order_params[:user_id])
35
- else
36
- current_api_user
37
- end
38
-
39
- import_params = if @current_user_roles.include?("admin")
40
- params[:order].present? ? params[:order].permit! : {}
41
- else
42
- order_params
43
- end
44
-
45
- @order = Spree::Core::Importer::Order.import(order_user, import_params)
30
+ authorize! :create, Order
31
+ order_user = if @current_user_roles.include?('admin') && order_params[:user_id]
32
+ Spree.user_class.find(order_params[:user_id])
33
+ else
34
+ current_api_user
35
+ end
46
36
 
47
- respond_with(@order, default_template: :show, status: 201)
37
+ import_params = if @current_user_roles.include?("admin")
38
+ params[:order].present? ? params[:order].permit! : {}
48
39
  else
49
- @order = Spree::Order.create!(user: current_api_user, store: current_store)
50
- if @order.contents.update_cart(order_params)
51
- respond_with(@order, default_template: :show, status: 201)
52
- else
53
- invalid_resource!(@order)
54
- end
40
+ order_params
55
41
  end
42
+
43
+ @order = Spree::Core::Importer::Order.import(order_user, import_params)
44
+ respond_with(@order, default_template: :show, status: 201)
56
45
  end
57
46
 
58
47
  def empty
59
48
  authorize! :update, @order, order_token
60
49
  @order.empty!
61
- render text: nil, status: 204
50
+ render plain: nil, status: 204
62
51
  end
63
52
 
64
53
  def index
@@ -17,7 +17,6 @@ module Spree
17
17
  end
18
18
 
19
19
  def create
20
- @order.validate_payments_attributes([payment_params])
21
20
  @payment = @order.payments.build(payment_params)
22
21
  if @payment.save
23
22
  respond_with(@payment, status: 201, default_template: :show)
@@ -11,14 +11,14 @@ module Spree
11
11
  end
12
12
 
13
13
  @products = @products.distinct.page(params[:page]).per(params[:per_page])
14
- expires_in 15.minutes, :public => true
14
+ expires_in 15.minutes, public: true
15
15
  headers['Surrogate-Control'] = "max-age=#{15.minutes}"
16
16
  respond_with(@products)
17
17
  end
18
18
 
19
19
  def show
20
20
  @product = find_product(params[:id])
21
- expires_in 15.minutes, :public => true
21
+ expires_in 15.minutes, public: true
22
22
  headers['Surrogate-Control'] = "max-age=#{15.minutes}"
23
23
  headers['Surrogate-Key'] = "product_id=1"
24
24
  respond_with(@product)
@@ -57,6 +57,9 @@ module Spree
57
57
  # shipping_category: "Free Shipping Items"
58
58
  # }
59
59
  #
60
+ def new
61
+ end
62
+
60
63
  def create
61
64
  authorize! :create, Product
62
65
  params[:product][:available_on] ||= Time.current
@@ -66,7 +69,7 @@ module Spree
66
69
  @product = Core::Importer::Product.new(nil, product_params, options).create
67
70
 
68
71
  if @product.persisted?
69
- respond_with(@product, :status => 201, :default_template => :show)
72
+ respond_with(@product, status: 201, default_template: :show)
70
73
  else
71
74
  invalid_resource!(@product)
72
75
  end
@@ -80,7 +83,7 @@ module Spree
80
83
  @product = Core::Importer::Product.new(@product, product_params, options).update
81
84
 
82
85
  if @product.errors.empty?
83
- respond_with(@product.reload, :status => 200, :default_template => :show)
86
+ respond_with(@product.reload, status: 200, default_template: :show)
84
87
  else
85
88
  invalid_resource!(@product)
86
89
  end
@@ -90,7 +93,7 @@ module Spree
90
93
  @product = find_product(params[:id])
91
94
  authorize! :destroy, @product
92
95
  @product.destroy
93
- respond_with(@product, :status => 204)
96
+ respond_with(@product, status: 204)
94
97
  end
95
98
 
96
99
  private
@@ -64,7 +64,7 @@ module Spree
64
64
  end
65
65
 
66
66
  def scope
67
- includes = {:variant => [{ :option_values => :option_type }, :product] }
67
+ includes = { variant: [{ option_values: :option_type }, :product] }
68
68
  @stock_location.stock_items.accessible_by(current_ability, :read).includes(includes)
69
69
  end
70
70
 
@@ -34,7 +34,7 @@ module Spree
34
34
  def destroy
35
35
  authorize! :destroy, stock_location
36
36
  stock_location.destroy
37
- respond_with(stock_location, :status => 204)
37
+ respond_with(stock_location, status: 204)
38
38
  end
39
39
 
40
40
  private
@@ -0,0 +1,28 @@
1
+ module Spree
2
+ module Api
3
+ module V1
4
+ class TagsController < Spree::Api::BaseController
5
+ def index
6
+ @tags =
7
+ if params[:ids]
8
+ Tag.where(id: params[:ids].split(",").flatten)
9
+ else
10
+ Tag.ransack(params[:q]).result
11
+ end
12
+
13
+ @tags = @tags.page(params[:page]).per(params[:per_page])
14
+
15
+ expires_in 15.minutes, public: true
16
+ headers['Surrogate-Control'] = "max-age=#{15.minutes}"
17
+ respond_with(@tags)
18
+ end
19
+
20
+ private
21
+
22
+ def tags_params
23
+ params.require(:tag).permit(permitted_tags_attributes)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -16,11 +16,14 @@ module Spree
16
16
  show
17
17
  end
18
18
 
19
+ def new
20
+ end
21
+
19
22
  def create
20
23
  authorize! :create, Taxonomy
21
24
  @taxonomy = Taxonomy.new(taxonomy_params)
22
25
  if @taxonomy.save
23
- respond_with(@taxonomy, :status => 201, :default_template => :show)
26
+ respond_with(@taxonomy, status: 201, default_template: :show)
24
27
  else
25
28
  invalid_resource!(@taxonomy)
26
29
  end
@@ -29,7 +32,7 @@ module Spree
29
32
  def update
30
33
  authorize! :update, taxonomy
31
34
  if taxonomy.update_attributes(taxonomy_params)
32
- respond_with(taxonomy, :status => 200, :default_template => :show)
35
+ respond_with(taxonomy, status: 200, default_template: :show)
33
36
  else
34
37
  invalid_resource!(taxonomy)
35
38
  end
@@ -38,13 +41,13 @@ module Spree
38
41
  def destroy
39
42
  authorize! :destroy, taxonomy
40
43
  taxonomy.destroy
41
- respond_with(taxonomy, :status => 204)
44
+ respond_with(taxonomy, status: 204)
42
45
  end
43
46
 
44
47
  private
45
48
 
46
49
  def taxonomies
47
- @taxonomies = Taxonomy.accessible_by(current_ability, :read).order('name').includes(:root => :children).
50
+ @taxonomies = Taxonomy.accessible_by(current_ability, :read).order('name').includes(root: :children).
48
51
  ransack(params[:q]).result.
49
52
  page(params[:page]).per(params[:per_page])
50
53
  end
@@ -26,6 +26,9 @@ module Spree
26
26
  show
27
27
  end
28
28
 
29
+ def new
30
+ end
31
+
29
32
  def create
30
33
  authorize! :create, Taxon
31
34
  @taxon = Spree::Taxon.new(taxon_params)
@@ -33,7 +36,7 @@ module Spree
33
36
  taxonomy = Spree::Taxonomy.find_by(id: params[:taxonomy_id])
34
37
 
35
38
  if taxonomy.nil?
36
- @taxon.errors[:taxonomy_id] = I18n.t(:invalid_taxonomy_id, scope: 'spree.api')
39
+ @taxon.errors.add(:taxonomy_id, I18n.t('spree.api.invalid_taxonomy_id'))
37
40
  invalid_resource!(@taxon) and return
38
41
  end
39
42
 
@@ -7,6 +7,8 @@ module Spree
7
7
 
8
8
  def index
9
9
  @users = Spree.user_class.accessible_by(current_ability,:read).ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
10
+ expires_in 15.minutes, public: true
11
+ headers['Surrogate-Control'] = "max-age=#{15.minutes}"
10
12
  respond_with(@users)
11
13
  end
12
14
 
@@ -21,7 +23,7 @@ module Spree
21
23
  authorize! :create, Spree.user_class
22
24
  @user = Spree.user_class.new(user_params)
23
25
  if @user.save
24
- respond_with(@user, :status => 201, :default_template => :show)
26
+ respond_with(@user, status: 201, default_template: :show)
25
27
  else
26
28
  invalid_resource!(@user)
27
29
  end
@@ -30,7 +32,7 @@ module Spree
30
32
  def update
31
33
  authorize! :update, user
32
34
  if user.update_attributes(user_params)
33
- respond_with(user, :status => 200, :default_template => :show)
35
+ respond_with(user, status: 200, default_template: :show)
34
36
  else
35
37
  invalid_resource!(user)
36
38
  end
@@ -39,7 +41,7 @@ module Spree
39
41
  def destroy
40
42
  authorize! :destroy, user
41
43
  user.destroy
42
- respond_with(user, :status => 204)
44
+ respond_with(user, status: 204)
43
45
  end
44
46
 
45
47
  private