dry_serialization 0.4.1 → 0.4.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
  SHA256:
3
- metadata.gz: 8154638554abdc2750980b2a7e02616ec1ed918b61ea9437ef5d242788fb3673
4
- data.tar.gz: 6a3bccc9255e0beaeb3314c2ccf3c65154c3f3681c4aee1f1ea3206b75dec77a
3
+ metadata.gz: d459a861acc9de313bcab71122b336f30d34666a3411400e4cb54bea9183fbf3
4
+ data.tar.gz: 2a81afbac8b773d22afb9bd0707472a08404e35d482ee6e495442f4ae4fa7982
5
5
  SHA512:
6
- metadata.gz: 1d04290d2ebb061f6b6f350c5c9243d8c096c86d95d82ac50d8aa7831410862773aaece337656287c41facb93b67302b63a82fe4a84bbe6e8794ad2aa026e0a5
7
- data.tar.gz: cba06d23936b7c61bcc053abb3ae196f7c726bf43790146e7eee95b3bbc1fa16fdc28224a3a99940e4812ff7f77fb6e7358ef3f73cecdfcc608512ae647a2027
6
+ metadata.gz: 4d40cd9fd0eed6bfa27bbd405db14839215d456b6c5d32712338c8947be74fabb6e9c6ec92c4a45dce44aee0e5934aa3788aec4463067fe233f4cde53ce29a72
7
+ data.tar.gz: c048532d1db6519248e62c4923f6528c977e55a2c4cfd0c1a4f6469c3d21ecdfb5158351806cc2431b059e1ef5f40d3f0cf58a70f7d13521867ca89ffc2089b1
@@ -2,21 +2,16 @@ module DrySerialization
2
2
  module Concerns
3
3
  module SerializationHelper
4
4
  def success_response(data = {}, status = :ok)
5
- default_response = default_response(data, status)
6
- render json: default_response
5
+ render json: data, status: status
7
6
  end
8
-
7
+
9
8
  def error_response(errors, status = :unprocessable_entity)
10
9
  errors = [errors] unless errors.is_a?(Array)
11
10
  errors = { errors: errors }
12
- default_response = default_response(errors, status)
13
-
14
- render json: default_response
15
- end
16
-
17
- def default_response(data, status)
18
- { status: status }.merge(data)
11
+
12
+ render json: errors, status: status
19
13
  end
14
+
20
15
  end
21
16
  end
22
- end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module DrySerialization
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry_serialization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Heft
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-23 00:00:00.000000000 Z
11
+ date: 2020-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler