<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -82,6 +82,7 @@ module ActiveRecord
       #   expected_options = { :conditions =&gt; { :colored =&gt; 'red' } }
       #   assert_equal expected_options, Shirt.colored('red').proxy_options
       def named_scope(name, options = {}, &amp;block)
+        name = name.to_sym
         scopes[name] = lambda do |parent_scope, *args|
           Scope.new(parent_scope, case options
             when Hash</diff>
      <filename>activerecord/lib/active_record/named_scope.rb</filename>
    </modified>
    <modified>
      <diff>@@ -59,6 +59,12 @@ class NamedScopeTest &lt; ActiveRecord::TestCase
     assert_equal Topic.count(:conditions =&gt; {:approved =&gt; true}), Topic.approved.count
   end
 
+  def test_scopes_with_string_name_can_be_composed
+    # NOTE that scopes defined with a string as a name worked on their own
+    # but when called on another scope the other scope was completely replaced
+    assert_equal Topic.replied.approved, Topic.replied.approved_as_string
+  end
+
   def test_scopes_are_composable
     assert_equal (approved = Topic.find(:all, :conditions =&gt; {:approved =&gt; true})), Topic.approved
     assert_equal (replied = Topic.find(:all, :conditions =&gt; 'replies_count &gt; 0')), Topic.replied</diff>
      <filename>activerecord/test/cases/named_scope_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ class Topic &lt; ActiveRecord::Base
     { :conditions =&gt; ['written_on &lt; ?', time] }
   }
   named_scope :approved, :conditions =&gt; {:approved =&gt; true}
+  named_scope 'approved_as_string', :conditions =&gt; {:approved =&gt; true}
   named_scope :replied, :conditions =&gt; ['replies_count &gt; 0']
   named_scope :anonymous_extension do
     def one</diff>
      <filename>activerecord/test/models/topic.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>43cbcb10ae85adc4403e950e69ee14123a20d8ae</id>
    </parent>
  </parents>
  <author>
    <name>Tarmo T&#228;nav</name>
    <email>tarmo@itech.ee</email>
  </author>
  <url>http://github.com/rails/rails/commit/1afae84ab2656cd58a861ab4a4b1745d80088d0f</url>
  <id>1afae84ab2656cd58a861ab4a4b1745d80088d0f</id>
  <committed-date>2008-06-22T17:26:00-07:00</committed-date>
  <authored-date>2008-06-13T13:39:10-07:00</authored-date>
  <message>Fixed that scopes defined with a string name could not be composed</message>
  <tree>29544057e3738abdc680d795aa8fe49ebdf1176b</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
