lib/postgis_functions.rb in nofxx-postgis_adapter-0.5.6 vs lib/postgis_functions.rb in nofxx-postgis_adapter-0.5.7
- old
+ new
@@ -73,13 +73,13 @@
fields = fields.join(",")
else
fields = fields.join(" #{options} ")
end
- sql = "SELECT #{opcode}(#{fields}) "
- sql << "FROM #{tables.join(",")} " if tables
- sql << "WHERE #{conditions.join(" AND ")}" if conditions
- #p sql; sql
+ sql = "SELECT #{opcode}(#{fields}) "
+ sql << "FROM #{tables.join(",")} " unless tables.empty?
+ sql << "WHERE #{conditions.join(" AND ")}" unless conditions.empty?
+ sql
end
#
# Execute the query and parse the return.
# We may receive: