deep_unrest 0.1.49 → 0.1.50

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: 58d7fd7e14fd2a97dc1d868befab4fef1727f66eae798dec56548140235a758e
4
- data.tar.gz: 8ed1efaabc8d392f48c10ef4605fdb362bfbe542952b310b8390438dbb631c45
3
+ metadata.gz: 97407994fc42e7c7bce4ba6c99f90b293a612ef53ad521dd641076e20b73c74d
4
+ data.tar.gz: 86f8c59daea5bf4f6b5bbd24635bc0c35683fb256fd6030df55c2b7efb363123
5
5
  SHA512:
6
- metadata.gz: 7203d7f3b44f9de78cbe3baf5f9cad123d40bd46e9fe611d813819036a1a97a2a741998c618871e58a979ffefb28ad8d1513ef83bad91d35adc8f820f57fb485
7
- data.tar.gz: 5bd0b09ead529ace24f9a0e082c85da51511e7381e6e7d67f798695627cc112c7e08eaf16df68233a7be1f21b256c3760e7b013e96e5e9fd774c08423b4d2110
6
+ metadata.gz: af2cbe3c9a14be48536ced9014aff929f5add1e535a9553b4bf20f3ddde2078b851d77772d9f9b5e86a1702ea59a30ab0436463662426e36a750f2aa8c370b93
7
+ data.tar.gz: 799d0e1d06b90cafbbce66460b5d8f1a73fea46ec172e4c467150d970e679e1d39e15794edc3a7976c59b0fbb2b37f107dc286c166b5413ddb44a9d9993f7e28
@@ -108,6 +108,8 @@ module DeepUnrest
108
108
 
109
109
  # monkey patch the resource to only show authorized records
110
110
  r_metaclass = class << resource; self; end
111
+ r_metaclass.send(:alias_method, :records_original, :records)
112
+ # TODO: find a way to do this that doesn't blow out the original :records method
111
113
  r_metaclass.send(:define_method, :records) { |_ctx| item[:scope] }
112
114
 
113
115
  # transform sort value casing for rails
@@ -121,6 +123,9 @@ module DeepUnrest
121
123
 
122
124
  jsonapi_result = processor.process
123
125
 
126
+ # un-monkey patch the resource :records method
127
+ r_metaclass.send(:alias_method, :records_original, :records)
128
+
124
129
  meta << {
125
130
  addr: [*addr, item[:key], 'meta'],
126
131
  serialized_result: {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeepUnrest
4
- VERSION = '0.1.49'
4
+ VERSION = '0.1.50'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep_unrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.49
4
+ version: 0.1.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lynn Hurley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-28 00:00:00.000000000 Z
11
+ date: 2019-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails