<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -67,38 +67,36 @@ module DataMapper
         
         def extract_options(query_conditions)
           options = {}
-          duration_range = {:min =&gt; nil, :max =&gt; nil}
+          duration_range = { :min =&gt; nil, :max =&gt; nil }
           duration_matcher = nil
-            query_conditions.each do |condition|
-              op, prop, value = condition
-              case prop.field
-                when &quot;title&quot;
-                  if op == :eql
-                    title_matcher = value
-                  elsif op == :like
-                    title_matcher = Regexp.new(value)
-                  end
-                  options.merge!({:title =&gt; title_matcher})
-                
-                when &quot;duration&quot;
-                  raise GvideoInterface::ConditionsError, &quot;duration in seconds needs to be expressed using an Integer&quot; unless value.is_a?(Integer)
-                  case op  
-                    when :eql then duration_matcher = value
-                    when :gte then duration_range[:min] = value
-                    when :lte then duration_range[:max] = value
-                    when :lt  then duration_range[:max] = value - 1
-                    when :gt  then duration_range[:min] = value + 1
-                  end
-                  
-                else 
-                  raise GvideoInterface::ConditionsError, &quot;#{prop.field.to_sym} not supported as a condition&quot;
+
+          query_conditions.each do |condition|
+            operator, property, value = condition
+            case property.name
+              when :title
+                case operator
+                  when :eql  then title_matcher = value
+                  when :like then title_matcher = Regexp.new(value)
                 end
-              end
-            
-            options.merge!({:duration =&gt; duration_matcher}) if duration_matcher
-            options.merge!({:duration =&gt; (duration_range[:min] || 0)..(duration_range[:max] || 9999) }) if (duration_range[:min] || duration_range[:max])
-        
-          return options
+                options.merge!(:title =&gt; title_matcher)
+              when :duration
+                raise GvideoInterface::ConditionsError, &quot;duration in seconds needs to be expressed using an Integer&quot; unless value.is_a?(Integer)
+                case operator
+                  when :eql then duration_matcher = value
+                  when :gte then duration_range[:min] = value
+                  when :gt  then duration_range[:min] = value + 1
+                  when :lte then duration_range[:max] = value
+                  when :lt  then duration_range[:max] = value - 1
+                end
+              else
+                raise GvideoInterface::ConditionsError, &quot;#{property.name} not supported as a condition&quot;
+            end
+          end
+
+          options.merge!(:duration =&gt; duration_matcher) if duration_matcher
+          options.merge!(:duration =&gt; (duration_range[:min] || 0)..(duration_range[:max] || 9999)) if duration_range[:min] || duration_range[:max]
+
+          options
         end
       
     end #GvideoAdapter</diff>
      <filename>lib/dm-gvideo-adapter.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>046d02489664228bfe58eb86cce32f8cb3229907</id>
    </parent>
  </parents>
  <author>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </author>
  <url>http://github.com/mattetti/dm-gvideo-adapter/commit/fcce0de0203f947a0406bdf57f39d1ec2de9842b</url>
  <id>fcce0de0203f947a0406bdf57f39d1ec2de9842b</id>
  <committed-date>2008-09-29T10:42:02-07:00</committed-date>
  <authored-date>2008-09-29T10:42:02-07:00</authored-date>
  <message>further refactoring</message>
  <tree>0181ba0c2a242970ef4888037e894412b0e47db8</tree>
  <committer>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </committer>
</commit>
