graphiti-activegraph 0.1.7 → 0.1.8

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: 4ce7eee981fcd7439be5bba5208039c3c64503edcaaca9ef767cba7b27b5fd22
4
- data.tar.gz: d591ab8b478dafe188a47a16044e998115afc9643e75e67e89036dd97891e092
3
+ metadata.gz: 27f568c2558fd90927efbdfe9a027deaec2bbfa78e4661cef40e3cfd69513580
4
+ data.tar.gz: 9601ee6142701b1a412b3c93975b97877fec63e8ab11cc1d4fc327837ef580eb
5
5
  SHA512:
6
- metadata.gz: 2934711d909710ba68d3c4a86a4c09354190099a775fdb89258daeefa2d185d637b86bc1a635608a14e384c34b18526d7c293ea33db51e47dd5aa9195f29d6e8
7
- data.tar.gz: 7baf44eebc6191ac5cb1ce3e6ed7482ac95c495706c67c0bb7f0c090e58d423568bd3f35af914c95b21107322d88691a1a0975c70111c83fa763f695e7dd8477
6
+ metadata.gz: e8f536280c38952208a5e5c1d4355799b9e8fe46dfaf14f83678031cf6d23149341093860d7fb822cf23daad5658bf07561daa547e23befb5fab253b76219c8f
7
+ data.tar.gz: 760b8d94785cdae51b83c7604ee4a5cadc4c8c88a9c7704a33466f86de2965634a68d0aaf792d403ff418f5ecfca9f8dbac69089afba42151fd98ff4fa7088a6
data/CHANGELOG.md CHANGED
@@ -0,0 +1,15 @@
1
+ ## Unreleased
2
+
3
+ -
4
+
5
+ ## 0.1.8 (09-06-2021)
6
+
7
+ Features:
8
+
9
+ - Added support for polymorphic relationship.
10
+
11
+ <!-- ### [version (DD-MM-YYYY)](diff_link) -->
12
+ <!-- Breaking changes:-->
13
+ <!-- Features:-->
14
+ <!-- Fixes:-->
15
+ <!-- Misc:-->
@@ -4,7 +4,9 @@ module Graphiti::ActiveGraph
4
4
  def self.sideloading_classes
5
5
  {
6
6
  has_many: Graphiti::ActiveGraph::Adapters::ActiveGraph::HasManySideload,
7
- has_one: Graphiti::ActiveGraph::Adapters::ActiveGraph::HasOneSideload
7
+ has_one: Graphiti::ActiveGraph::Adapters::ActiveGraph::HasOneSideload,
8
+ polymorphic_belongs_to: Graphiti::ActiveGraph::Adapters::ActiveGraph::PolymorphicBelongsTo,
9
+ belongs_to: Graphiti::ActiveGraph::Adapters::ActiveGraph::HasOneSideload,
8
10
  }
9
11
  end
10
12
 
@@ -0,0 +1,15 @@
1
+ class Graphiti::ActiveGraph::Adapters::ActiveGraph::PolymorphicBelongsTo < Graphiti::Sideload::PolymorphicBelongsTo
2
+ include Graphiti::ActiveGraph::Adapters::ActiveGraph::Sideload
3
+
4
+ def default_base_scope
5
+ resource_class.model.all
6
+ end
7
+
8
+ def infer_foreign_key
9
+ association_name.to_sym
10
+ end
11
+
12
+ def default_value_when_empty
13
+ nil
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Graphiti
2
2
  module ActiveGraph
3
- VERSION = '0.1.7'
3
+ VERSION = '0.1.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti-activegraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hardik Joshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphiti
@@ -196,6 +196,7 @@ files:
196
196
  - lib/graphiti/active_graph/adapters/active_graph.rb
197
197
  - lib/graphiti/active_graph/adapters/active_graph/has_many_sideload.rb
198
198
  - lib/graphiti/active_graph/adapters/active_graph/has_one_sideload.rb
199
+ - lib/graphiti/active_graph/adapters/active_graph/polymorphic_belongs_to.rb
199
200
  - lib/graphiti/active_graph/adapters/active_graph/sideload.rb
200
201
  - lib/graphiti/active_graph/deserializer.rb
201
202
  - lib/graphiti/active_graph/query.rb