deep_unrest 0.1.48 → 0.1.49

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: 0467a96ff1929f217600d034920abd78ba453334086432c9dea52f84242be460
4
- data.tar.gz: 5ad9ace22857d18bbb8488f658b47a8689cd77f7e03c178f048944b50e1e3101
3
+ metadata.gz: 58d7fd7e14fd2a97dc1d868befab4fef1727f66eae798dec56548140235a758e
4
+ data.tar.gz: 8ed1efaabc8d392f48c10ef4605fdb362bfbe542952b310b8390438dbb631c45
5
5
  SHA512:
6
- metadata.gz: 88d0cd80ddf6a04448ba24c1c169f528963d15350d97594b678bbd6e5b2ff9384fbf9745cfb8827f788d27575ef9c941b89a0b24ef275e165400d6b2038c8fd2
7
- data.tar.gz: c2353a72117e3cb4acd3e186e15132e1d4b16f095d48613ca73be72675116b8e7fe1914d64a7afcd4d0ee9da5fc1d1df5e0b52f40ac10c91a6f326bf07f2847d
6
+ metadata.gz: 7203d7f3b44f9de78cbe3baf5f9cad123d40bd46e9fe611d813819036a1a97a2a741998c618871e58a979ffefb28ad8d1513ef83bad91d35adc8f820f57fb485
7
+ data.tar.gz: 5bd0b09ead529ace24f9a0e082c85da51511e7381e6e7d67f798695627cc112c7e08eaf16df68233a7be1f21b256c3760e7b013e96e5e9fd774c08423b4d2110
@@ -650,7 +650,7 @@ module DeepUnrest
650
650
 
651
651
  ### SHARED ###
652
652
  def self.deep_underscore_keys(query)
653
- query.deep_transform_keys! do |key|
653
+ query&.deep_transform_keys! do |key|
654
654
  k = begin
655
655
  key.to_s.underscore
656
656
  rescue StandardError
@@ -664,6 +664,21 @@ module DeepUnrest
664
664
  end
665
665
  end
666
666
 
667
+ def self.deep_camelize_keys(query)
668
+ query&.deep_transform_keys! do |key|
669
+ k = begin
670
+ key.to_s.camelize(:lower)
671
+ rescue StandardError
672
+ key
673
+ end
674
+ begin
675
+ k.to_sym
676
+ rescue StandardError
677
+ key
678
+ end
679
+ end
680
+ end
681
+
667
682
  def self.collect_authorized_scopes(mappings, user)
668
683
  mappings.each do |mapping|
669
684
  mapping[:scope] = DeepUnrest.authorization_strategy.get_authorized_scope(user, mapping[:klass])
@@ -128,7 +128,7 @@ module DeepUnrest
128
128
  recordCount: jsonapi_result.record_count,
129
129
  sort: query[:sort],
130
130
  paginate: query[:paginate],
131
- filter: query[:filter]
131
+ filter: DeepUnrest.deep_camelize_keys(query[:filter])
132
132
  }
133
133
  }
134
134
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeepUnrest
4
- VERSION = '0.1.48'
4
+ VERSION = '0.1.49'
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.48
4
+ version: 0.1.49
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-11 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails