<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,6 @@
 GEOPOST_ROOT = File.dirname(__FILE__)
-GEOCODED_ROOT = &quot;/home/tempest/geocoded&quot;
-DRIVETIME_ROOT = &quot;/home/tempest/drivetime&quot;
+GEOCODED_ROOT = &quot;/home/nonstop/geocoded&quot;
+DRIVETIME_ROOT = &quot;/home/nonstop/drivetime&quot;
 
 $LOAD_PATH &lt;&lt; File.expand_path(File.dirname(__FILE__))
 </diff>
      <filename>lib/putsgis.rb</filename>
    </modified>
    <modified>
      <diff>@@ -108,7 +108,9 @@ module PutsGIS
                                :geom_col =&gt; :temporal_geom,
                                :geom =&gt; false,
                                :fkey =&gt; :id,
+                               :join_conditions =&gt; {},
                                :in =&gt; true,
+                               :order =&gt; false,
                                :select =&gt; :all,
                                :distance =&gt; false,
                                :drive =&gt; nil,
@@ -186,7 +188,14 @@ module PutsGIS
             sql &lt;&lt; &quot;#{table}.#{fkey} #{notin}&quot;
             sql &lt;&lt; &quot;(SELECT DISTINCT on (#{table}.#{fkey}) #{table}.#{fkey} FROM #{object_table} 
                   INNER JOIN #{table} ON #{table}.#{fkey}=#{object_table}.#{self.to_s.downcase}_#{fkey}
-                  WHERE (#{function}(#{object_table}.#{geom_kind},(SELECT #{geom_kind} FROM #{geom_b} WHERE id = #{geom_b_id})) = #{options[:outcome]}))&quot;
+                  WHERE ((#{function}(#{object_table}.#{geom_kind},(SELECT #{geom_kind} FROM #{geom_b} WHERE id = #{geom_b_id})) = #{options[:outcome]})&quot;
+              if options[:join_conditions].any?
+                options[:join_conditions].each_pair do |key,value|
+                  sql_value = value
+                  sql &lt;&lt; &quot;AND #{object_table}.#{key} #{sql_value}))&quot;
+                end
+              end
+
             if subquery.any?
               function = &quot;ST_#{subquery[:function].to_s.camelize}&quot;
               case subquery[:geom_kind]
@@ -216,7 +225,7 @@ module PutsGIS
             if options[:distance]
               distance = &quot;,#{units(options[:distance],options[:units])}&quot;
             end
-            sql &lt;&lt; &quot;WHERE (#{function}(#{table_name}.#{geom_kind},(#{select_geom})#{distance}) = #{options[:outcome]})&quot;
+              sql &lt;&lt; &quot;WHERE (#{function}(#{table_name}.#{geom_kind},(#{select_geom})#{distance}) = #{options[:outcome]})&quot;
           end
           if options[:destination]
             destination = options[:destination].to_s.pluralize
@@ -232,6 +241,8 @@ module PutsGIS
             options[:conditions].each_pair do |key,value|
               if value.to_s.split('')[0] =~ /^&gt;|^&lt;/
                 sql_value = value
+              elsif value == :not_null
+                sql_value = &quot;IS NOT NULL&quot;
               else
                 sql_value = &quot;= '#{value}'&quot;
               end
@@ -242,6 +253,7 @@ module PutsGIS
             sql[2] = sql[2].gsub(/AND/,'AND (')
             sql[-1] = sql[-1].gsub(/$/,')')
           end
+          sql &lt;&lt; &quot;ORDER BY RANDOM()&quot; if options[:order] = :rand
           if options[:select] != :all
             connection.select_values sql.join(' ')
           else</diff>
      <filename>lib/putsgis/putsgis.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>107883f8f4d3729e799318afe68cc061b36adf5d</id>
    </parent>
  </parents>
  <author>
    <name>Jamie Brough</name>
    <email>jb@tempestattack.com</email>
  </author>
  <url>http://github.com/broughcut/acts_as_line/commit/1493226ab41986a4f7c57b18c628bf0abdc251ed</url>
  <id>1493226ab41986a4f7c57b18c628bf0abdc251ed</id>
  <committed-date>2008-04-10T03:16:31-07:00</committed-date>
  <authored-date>2008-04-10T03:16:31-07:00</authored-date>
  <message>custom revisions for own project</message>
  <tree>cde05fe1575ee905839669e4da8280da67d3da7f</tree>
  <committer>
    <name>Jamie Brough</name>
    <email>jb@tempestattack.com</email>
  </committer>
</commit>
