lib/thingfish/metastore/pggraph/node.rb
changeset 3 5b4ee98d698c
parent 0 3cc90e88c6ab
child 7 f0ef12e25a2f
--- a/lib/thingfish/metastore/pggraph/node.rb	Thu Nov 05 10:40:01 2015 -0800
+++ b/lib/thingfish/metastore/pggraph/node.rb	Mon Dec 14 15:42:13 2015 -0800
@@ -69,6 +69,24 @@
 		end
 
 
+		### Dataset method: Order results by the specified +columns+.
+		###
+		def order_metadata( *columns )
+			columns.flatten!
+			ds = self
+			columns.each do |column|
+				if Thingfish::Metastore::PG::Metadata.metadata_columns.include?( column.to_sym )
+					ds = ds.order_append( column.to_sym )
+				else
+					ds = ds.order_append( self.user_metadata_expr(column) )
+				end
+			end
+
+			return ds
+		end
+
+
+
 		#########
 		protected
 		#########