Fix criteria searches that include both 'relationship' and 'relation' fields.
--- a/lib/thingfish/metastore/pggraph.rb Tue Nov 01 17:12:49 2016 -0700
+++ b/lib/thingfish/metastore/pggraph.rb Wed Nov 09 22:38:18 2016 -0800
@@ -24,7 +24,7 @@
# Package version
- VERSION = '0.1.2'
+ VERSION = '0.1.3'
# Version control revision
REVISION = %q$Revision$
--- a/lib/thingfish/metastore/pggraph/node.rb Tue Nov 01 17:12:49 2016 -0700
+++ b/lib/thingfish/metastore/pggraph/node.rb Wed Nov 09 22:38:18 2016 -0800
@@ -54,9 +54,11 @@
#
else
if field.to_sym == :relationship
- ds = self.join_edges.filter( Sequel.pg_jsonb( :edges__prop ).get_text( field.to_s ) => value )
+ ds = ds.join_edges unless ds.joined_dataset?
+ ds = ds.filter( Sequel.pg_jsonb( :edges__prop ).get_text( field.to_s ) => value )
elsif field.to_sym == :relation
+ ds = ds.join_edges unless ds.joined_dataset?
ds = self.join_edges.filter( :edges__id_p => value )
else