# HG changeset patch # User Mahlon E. Smith # Date 1478759898 28800 # Node ID 1ad0d5bc50831681d20abb2109539fb71c486f2a # Parent f0ef12e25a2fe6d7f1e437772bec9a3f06324a72 Fix criteria searches that include both 'relationship' and 'relation' fields. diff -r f0ef12e25a2f -r 1ad0d5bc5083 lib/thingfish/metastore/pggraph.rb --- 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$ diff -r f0ef12e25a2f -r 1ad0d5bc5083 lib/thingfish/metastore/pggraph/node.rb --- 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