jsonapi_compliable 0.3.7 → 0.3.8

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: 94b1af61ddd1e002d1b59385bf2028d63e7576aa
4
- data.tar.gz: 03d618013ed14f5754c23a7751b87bf1ca256b92
3
+ metadata.gz: ab0e2b34af698b690cd0d1f5fea26dcc427cb8c2
4
+ data.tar.gz: e0e5a124231ae7e35fdaeb75365aa88537657ad8
5
5
  SHA512:
6
- metadata.gz: e038ca0e33cfe9f7499ab4542635e0441c77705587ce8d32976e46014794aa29ff8c09f78917e75f90e8980e11fb55dc86da99b0895ab265c1d9d21cb2df3a76
7
- data.tar.gz: 9a4c46977256feb22e9b3fe90bc73030aa2ca8cfb43f06490e163c291ca74b4b2d6963e19b35b0cd19e008eb344017eb125e207ea761d4f350c3459df64c7f6f
6
+ metadata.gz: f9f74ff51519f73a6e85cd3c1b0dac20dc4111b044d7c93e9218415cf647143a9b57bf76c23c8611e66f2d509df3779e08a46644d8696d6678284b7702120252
7
+ data.tar.gz: 762dc586bda947c104cea4aec73ee89164608644dc10aa09f552dca22762307f9eff761a8b78256899242c1153ce24928d6fa72d9ac5af6d43eca113427a89a5
@@ -101,7 +101,10 @@ module JsonapiCompliable
101
101
  if !self._jsonapi_compliable
102
102
  dsl = JsonapiCompliable::DSL.new
103
103
  self._jsonapi_compliable = dsl
104
+ else
105
+ self._jsonapi_compliable = self._jsonapi_compliable.copy
104
106
  end
107
+
105
108
  self._jsonapi_compliable.instance_eval(&blk)
106
109
  end
107
110
  end
@@ -8,6 +8,21 @@ module JsonapiCompliable
8
8
  :pagination
9
9
 
10
10
  def initialize
11
+ clear!
12
+ end
13
+
14
+ def copy
15
+ instance = self.class.new
16
+ instance.sideloads = sideloads.deep_dup
17
+ instance.filters = filters.deep_dup
18
+ instance.default_filters = default_filters.deep_dup
19
+ instance.extra_fields = extra_fields.deep_dup
20
+ instance.sorting = sorting.deep_dup
21
+ instance.pagination = pagination.deep_dup
22
+ instance
23
+ end
24
+
25
+ def clear!
11
26
  @sideloads = {}
12
27
  @filters = {}
13
28
  @default_filters = {}
@@ -1,3 +1,3 @@
1
1
  module JsonapiCompliable
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_compliable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond