graphiti 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/graphiti/sideload.rb +15 -2
- data/lib/graphiti/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f71f80174c5c0982ea1f0d3c63ebcbccb76a9f6bac5b632e6a7a8b39460b2b8a
|
4
|
+
data.tar.gz: 48d23a31698373be0953c8a77e24e2f6cf4f0711e0bdee25ddcf4c74125f04cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02ae503dfeedd57ccd8a25e8f14432003dd11c2e20591fc21b26f1e8ea0afdd75c8be551ea6520e2da29f95a0d589b70fdad2d37b9be45c10ff813004fa1b417
|
7
|
+
data.tar.gz: 3f5e8ed4262a7e16b45068102ace2afadc43e5e8863f91d87db93573bc66e3cf85cce1889d4afd2fdabc691f2301e3b9499a4c4264bbe6cf7801ba333d932caa
|
data/lib/graphiti/sideload.rb
CHANGED
@@ -26,8 +26,8 @@ module Graphiti
|
|
26
26
|
@foreign_key = opts[:foreign_key]
|
27
27
|
@type = opts[:type]
|
28
28
|
@base_scope = opts[:base_scope]
|
29
|
-
@readable = opts[:readable]
|
30
|
-
@writable = opts[:writable]
|
29
|
+
@readable = evaluate_flag(opts[:readable])
|
30
|
+
@writable = evaluate_flag(opts[:writable])
|
31
31
|
@as = opts[:as]
|
32
32
|
@link = opts[:link]
|
33
33
|
@single = opts[:single]
|
@@ -411,5 +411,18 @@ module Graphiti
|
|
411
411
|
def namespace_for(klass)
|
412
412
|
Util::Class.namespace_for(klass)
|
413
413
|
end
|
414
|
+
|
415
|
+
def evaluate_flag(flag)
|
416
|
+
return false if flag.blank?
|
417
|
+
|
418
|
+
case flag.class.name
|
419
|
+
when "Symbol","String"
|
420
|
+
resource.send(flag)
|
421
|
+
when "Proc"
|
422
|
+
self.resource.instance_exec(&flag)
|
423
|
+
else
|
424
|
+
!!flag
|
425
|
+
end
|
426
|
+
end
|
414
427
|
end
|
415
428
|
end
|
data/lib/graphiti/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
@@ -345,7 +345,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
345
345
|
version: '0'
|
346
346
|
requirements: []
|
347
347
|
rubyforge_project:
|
348
|
-
rubygems_version: 2.
|
348
|
+
rubygems_version: 2.7.6
|
349
349
|
signing_key:
|
350
350
|
specification_version: 4
|
351
351
|
summary: Easily build jsonapi.org-compatible APIs
|