sanity-ruby 0.7.0 → 0.8.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 +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +11 -0
- data/README.md +7 -0
- data/lib/sanity/groq/select.rb +1 -1
- data/lib/sanity/helpers/type_helper.rb +2 -1
- data/lib/sanity/http/find.rb +1 -0
- data/lib/sanity/http/where.rb +2 -1
- data/lib/sanity/queryable.rb +2 -0
- data/lib/sanity/version.rb +1 -1
- metadata +4 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76349642b02272270f94ada31fe1f03f438490859eff6f1f987819ccf5ddb9dc
|
|
4
|
+
data.tar.gz: 246e2f225d6a6955f06aba7ffe29e718904887154423c61ee1de5ba5d03af65c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2287a0e8eba82e69213bef9e0e0c928da0a5fdc29ca21e50d99f43fbea0604093506331375c8277783ab564d07bc0589edd906eb19cc85b6c63e64672f80ccc
|
|
7
|
+
data.tar.gz: 60e53655e0e9156959a2a9c40978850501bd92f4bf94feb604e37418778bb91ba05b89ba1ea78bf5f3064bd5477a22456cdabef8a33ac1b8ce6661ca996febb8
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Checklist
|
|
6
|
+
|
|
7
|
+
- [ ] I have checked existing issues for duplicates
|
|
8
|
+
- [ ] I have run `bin/dev-test` locally and all tests pass
|
|
9
|
+
- [ ] I have run `bin/dev-lint` locally and there are no linting errors
|
|
10
|
+
- [ ] I have updated the README if this change affects documentation
|
|
11
|
+
|
data/README.md
CHANGED
|
@@ -127,6 +127,12 @@ class User < Sanity::Resource
|
|
|
127
127
|
queryable
|
|
128
128
|
publishable
|
|
129
129
|
end
|
|
130
|
+
|
|
131
|
+
# If your class name doesn't match the Sanity document type, use `document_type`:
|
|
132
|
+
class Cms::BlogPost < Sanity::Resource
|
|
133
|
+
self.document_type = :post
|
|
134
|
+
# ...
|
|
135
|
+
end
|
|
130
136
|
```
|
|
131
137
|
|
|
132
138
|
|
|
@@ -357,6 +363,7 @@ groq_query = <<-GROQ
|
|
|
357
363
|
GROQ
|
|
358
364
|
|
|
359
365
|
Sanity::Document.where(groq: groq_query, variables: {name: "Monsters, Inc."})
|
|
366
|
+
# Note: symbols are treated like strings when passed as variables
|
|
360
367
|
```
|
|
361
368
|
|
|
362
369
|
|
data/lib/sanity/groq/select.rb
CHANGED
data/lib/sanity/http/find.rb
CHANGED
data/lib/sanity/http/where.rb
CHANGED
|
@@ -7,6 +7,7 @@ module Sanity
|
|
|
7
7
|
module Http
|
|
8
8
|
class Where
|
|
9
9
|
include Sanity::Http::Query
|
|
10
|
+
|
|
10
11
|
delegate where_api_endpoint: :resource_klass
|
|
11
12
|
alias_method :api_endpoint, :where_api_endpoint
|
|
12
13
|
|
|
@@ -59,7 +60,7 @@ module Sanity
|
|
|
59
60
|
|
|
60
61
|
def serialize_variable_value(value)
|
|
61
62
|
case value
|
|
62
|
-
when String
|
|
63
|
+
when String, Symbol
|
|
63
64
|
"\"#{value}\""
|
|
64
65
|
when Array, Hash
|
|
65
66
|
value.to_json
|
data/lib/sanity/queryable.rb
CHANGED
data/lib/sanity/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sanity-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Drew Monroe
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activemodel
|
|
@@ -31,6 +30,7 @@ extensions: []
|
|
|
31
30
|
extra_rdoc_files: []
|
|
32
31
|
files:
|
|
33
32
|
- ".dockerignore"
|
|
33
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
34
34
|
- ".github/workflows/ci.yml"
|
|
35
35
|
- ".gitignore"
|
|
36
36
|
- ".standard.yml"
|
|
@@ -94,7 +94,6 @@ metadata:
|
|
|
94
94
|
homepage_uri: https://github.com/dvmonroe/sanity-ruby
|
|
95
95
|
source_code_uri: https://github.com/dvmonroe/sanity-ruby
|
|
96
96
|
changelog_uri: https://github.com/dvmonroe/sanity-ruby
|
|
97
|
-
post_install_message:
|
|
98
97
|
rdoc_options: []
|
|
99
98
|
require_paths:
|
|
100
99
|
- lib
|
|
@@ -109,8 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
108
|
- !ruby/object:Gem::Version
|
|
110
109
|
version: '0'
|
|
111
110
|
requirements: []
|
|
112
|
-
rubygems_version: 3.
|
|
113
|
-
signing_key:
|
|
111
|
+
rubygems_version: 3.6.9
|
|
114
112
|
specification_version: 4
|
|
115
113
|
summary: Ruby bindings for the Sanity API
|
|
116
114
|
test_files: []
|