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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dfadd6965148814ef19cb5133db0569b8a270b77
4
- data.tar.gz: a6a8be94b59ac1f28442e78d7c798e151790200a
2
+ SHA256:
3
+ metadata.gz: f71f80174c5c0982ea1f0d3c63ebcbccb76a9f6bac5b632e6a7a8b39460b2b8a
4
+ data.tar.gz: 48d23a31698373be0953c8a77e24e2f6cf4f0711e0bdee25ddcf4c74125f04cf
5
5
  SHA512:
6
- metadata.gz: 915c985439e531b0087f9b485f1366dba5cb47a440cacc3e5deb108a9045c6e7712c321cc55508916935dd71661ea260b46a687da180510161123fe2f7fa620f
7
- data.tar.gz: 3e95609716d75495448d370d595400c917efe68e7b6ff9217b6a499fd714de024285a72911b77eb6cb298eaad5955f4ab5dbfa35b3f880ed67b045147b6737ce
6
+ metadata.gz: 02ae503dfeedd57ccd8a25e8f14432003dd11c2e20591fc21b26f1e8ea0afdd75c8be551ea6520e2da29f95a0d589b70fdad2d37b9be45c10ff813004fa1b417
7
+ data.tar.gz: 3f5e8ed4262a7e16b45068102ace2afadc43e5e8863f91d87db93573bc66e3cf85cce1889d4afd2fdabc691f2301e3b9499a4c4264bbe6cf7801ba333d932caa
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
3
3
  end
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.5
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.5.2.3
348
+ rubygems_version: 2.7.6
349
349
  signing_key:
350
350
  specification_version: 4
351
351
  summary: Easily build jsonapi.org-compatible APIs