snfoil-rails 0.8.3 → 0.9.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4abac143f7db3746ad50a7835536622ca08da91556555127272e2d0727777283
|
4
|
+
data.tar.gz: 47a3e2f6b65d9fdcb7c8a0cc57a52c923c391186a2d0a7ec22823ddf2bc98769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a56430ee62d999e3700787f1796de5391695b6ea32b4726532e6c1479e04270a87bbdbe4d6be0cdce73d9c79c8ae8df378c4750b8c3aae0c3ed2caa8adc20892
|
7
|
+
data.tar.gz: 99a012a6a90c784dcecf959f93f2b4c19cf05cca1a32e7b966fc641ca9014948f8a9a0bad9cf697d9262c1ef758d8d6234c9f4e4327b39a62f0b4c7aa8105b43
|
@@ -24,11 +24,11 @@ module SnFoil
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def process_index(**options)
|
27
|
-
current_context(**options).index(options)
|
27
|
+
current_context(**options).index(**options)
|
28
28
|
end
|
29
29
|
|
30
30
|
def render_index(results, **options)
|
31
|
-
render paginate(results, **options), meta: meta(results, options)
|
31
|
+
render paginate(results, **options), meta: meta(results, **options)
|
32
32
|
end
|
33
33
|
|
34
34
|
def paginate(results, **options)
|
@@ -120,7 +120,7 @@ module SnFoil
|
|
120
120
|
return attributes unless resource_data
|
121
121
|
|
122
122
|
resource_data = data_id(resource_data, resource_data)
|
123
|
-
attribute_data = lookup_relationship(resource_data)
|
123
|
+
attribute_data = lookup_relationship(**resource_data)
|
124
124
|
relationship_data = { data: attribute_data || resource_data }
|
125
125
|
attributes[opts.fetch(:key) { key }] = deserializer.new(relationship_data, **options, included: included).parse
|
126
126
|
attributes
|
@@ -132,7 +132,7 @@ module SnFoil
|
|
132
132
|
|
133
133
|
attributes[opts.fetch(:key) { key }] = array_data.map do |resource_data|
|
134
134
|
resource_data = data_id(resource_data, resource_data)
|
135
|
-
attribute_data = lookup_relationship(resource_data)
|
135
|
+
attribute_data = lookup_relationship(**resource_data)
|
136
136
|
relationship_data = { data: attribute_data || resource_data }
|
137
137
|
deserializer.new(relationship_data, **options, included: included).parse
|
138
138
|
end
|
data/lib/sn_foil/searcher.rb
CHANGED
@@ -85,16 +85,14 @@ module SnFoil
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def apply_order(filtered_scope, params)
|
88
|
-
return apply_default_order(filtered_scope, params) if params[:order_by].blank? && params[:order].blank?
|
89
|
-
|
90
|
-
filtered_scope.order(order_by(params) => order(params))
|
91
|
-
end
|
92
|
-
|
93
|
-
def apply_default_order(filtered_scope, params)
|
94
88
|
return order_method(filtered_scope, params) if order_method?
|
95
89
|
return order_block(filtered_scope, params) if order_block?
|
96
90
|
|
97
|
-
|
91
|
+
if params[:order_by].blank? && params[:order].blank?
|
92
|
+
filtered_scope.order(order_by => order)
|
93
|
+
else
|
94
|
+
filtered_scope.order(order_by(params) => order(params))
|
95
|
+
end
|
98
96
|
end
|
99
97
|
|
100
98
|
def order_method(filtered_scope, params)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snfoil-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Howes
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-02-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -88,14 +88,14 @@ dependencies:
|
|
88
88
|
requirements:
|
89
89
|
- - '='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
91
|
+
version: 6.1.7.1
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - '='
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version:
|
98
|
+
version: 6.1.7.1
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: rake
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
- !ruby/object:Gem::Version
|
258
258
|
version: '0'
|
259
259
|
requirements: []
|
260
|
-
rubygems_version: 3.
|
260
|
+
rubygems_version: 3.4.7
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Additional functionality gem for using SnFoil with Rails
|