require 'helper' class EnrichmentDb::Datum < EnrichmentDb::DatumModel def self.by_id(schema_name, table_name, condition) puts "Finding object from #{table_name} with condition #{condition}." query = "SELECT * FROM #{schema_name}.#{table_name} where #{condition}" result = EnrichmentDb.request(schema_name, query) if result.ntuples > 0 puts "Found #{result.ntuples} object/s" result.collect do |v| v end else puts "Nothing found" nil end end end