<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -42,7 +42,7 @@ module DataMapper
       $LOAD_PATH &lt;&lt; (DM_PLUGINS_ROOT + '/dataobjects')
 
       FIND_OPTIONS = [
-        :select, :offset, :limit, :class, :include, :shallow_include, :reload, :conditions, :order, :intercept_load
+        :select, :offset, :limit, :class, :include, :shallow_include, :reload, :conditions, :order, :intercept_load, :from, :joins, :group
       ]
 
       TABLE_QUOTING_CHARACTER = '`'.freeze</diff>
      <filename>lib/data_mapper/adapters/data_object_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -126,7 +126,7 @@ module DataMapper
 
           end
           
-          attr_reader :conditions, :database_context, :options
+          attr_reader :conditions, :database_context, :options, :select, :from, :joins
           
           def initialize(adapter, database_context, primary_class, options = {})
             @adapter, @database_context, @primary_class = adapter, database_context, primary_class
@@ -146,8 +146,12 @@ module DataMapper
             end
             # END
             
+            @select = @options[:select] if @options[:select].is_a?(String)
+            @from = @options[:from]
+            @group = @options[:group]
             @order = @options[:order]
             @limit = @options[:limit]
+            @joins = @options[:joins]
             @offset = @options[:offset]
             @reload = @options[:reload]
             @instance_id = conditions_hash[:id]
@@ -161,6 +165,9 @@ module DataMapper
               #&lt;#{self.class.name}:0x%x
                 @database=#{@adapter.name}
                 @reload=#{@reload.inspect}
+                @from=#{@from.inspect}
+                @select=#{@select.inspect}
+                @joins=#{@joins.inspect}
                 @order=#{@order.inspect}
                 @limit=#{@limit.inspect}
                 @offset=#{@offset.inspect}
@@ -261,8 +268,19 @@ module DataMapper
           def to_parameterized_sql
             parameters = []
             
-            sql = 'SELECT ' &lt;&lt; columns_for_select.join(', ')
-            sql &lt;&lt; ' FROM ' &lt;&lt; from_table_name            
+            cfs = columns_for_select
+
+            if @select.nil?
+              sql = 'SELECT ' &lt;&lt; cfs.join(', ')
+            else
+              sql = 'SELECT ' &lt;&lt; @select.to_s
+            end
+
+            if @from.nil?
+              sql &lt;&lt; ' FROM ' &lt;&lt; from_table_name
+            else
+              sql &lt;&lt; ' FROM ' &lt;&lt; @from.to_s
+            end
             
             included_associations.each do |association|
               sql &lt;&lt; ' ' &lt;&lt; association.to_sql
@@ -271,6 +289,10 @@ module DataMapper
             shallow_included_associations.each do |association|
               sql &lt;&lt; ' ' &lt;&lt; association.to_shallow_sql
             end
+
+            unless @joins.nil?
+              sql &lt;&lt; @joins.to_s
+            end
             
             unless conditions_empty?
               sql &lt;&lt; ' WHERE ('
@@ -296,6 +318,10 @@ module DataMapper
               end
             end # unless conditions_empty?
             
+            unless @group.nil?
+              sql &lt;&lt; 'GROUP BY ' &lt;&lt; @group.to_s
+            end
+            
             unless @order.nil?
               sql &lt;&lt; ' ORDER BY ' &lt;&lt; @order.to_s
             end
@@ -421,6 +447,8 @@ module DataMapper
                   case x = @options[:select]
                   when Array then x
                   when Symbol then [x]
+                  when String
+                    primary_class_table.columns.reject { |column| column.lazy? }
                   else raise ':select option must be a Symbol, or an Array of Symbols'
                   end.map { |name| primary_class_table[name] }
                 else</diff>
      <filename>lib/data_mapper/adapters/sql/commands/load_command.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b4a0630cb95199a8753ed0d2aad917c51926feac</id>
    </parent>
  </parents>
  <author>
    <name>Lucas Carlson</name>
    <email>lucas@rufy.com</email>
  </author>
  <url>http://github.com/cardmagic/dm-works/commit/0692a24228cbc20ac92792400746f064ac4dfcbc</url>
  <id>0692a24228cbc20ac92792400746f064ac4dfcbc</id>
  <committed-date>2008-04-18T14:35:49-07:00</committed-date>
  <authored-date>2008-04-18T14:35:49-07:00</authored-date>
  <message>Adding :from, :joins, :group and :select (as string) options to finders so that there is more backwards compatibility with ActiveRecord</message>
  <tree>efa0df3029b038052458f6581444741babb32db6</tree>
  <committer>
    <name>Lucas Carlson</name>
    <email>lucas@rufy.com</email>
  </committer>
</commit>
