<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -253,8 +253,8 @@ module PageAttachmentTags
 
       options = {
         :order =&gt; &quot;#{by} #{order}&quot;,
-        :limit =&gt; attr[:limit] || nil,
         :offset =&gt; attr[:offset] || nil,
+        :limit =&gt; attr[:limit] || (attr[:offset] ? 9999 : nil),
         :conditions =&gt; conditions
       }
     end</diff>
      <filename>app/models/page_attachment_tags.rb</filename>
    </modified>
    <modified>
      <diff>@@ -118,6 +118,10 @@ class PageAttachmentsExtensionTest &lt; Test::Unit::TestCase
                   %{&lt;r:attachment:each limit=&quot;1&quot; offset=&quot;1&quot; by=&quot;filename&quot;&gt;&lt;r:link/&gt;&lt;/r:attachment:each&gt;}, '/'
     assert_renders %{&lt;a href=&quot;#{txt.public_filename}&quot;&gt;foo.txt&lt;/a&gt;},
                   %{&lt;r:attachment:each limit=&quot;1&quot; offset=&quot;0&quot; by=&quot;filename&quot;&gt;&lt;r:link/&gt;&lt;/r:attachment:each&gt;}, '/'
+    assert_renders %{&lt;a href=&quot;#{txt.public_filename}&quot;&gt;foo.txt&lt;/a&gt;},
+                  %{&lt;r:attachment:each limit=&quot;1&quot; by=&quot;filename&quot;&gt;&lt;r:link/&gt;&lt;/r:attachment:each&gt;}, '/'
+    assert_renders %{&lt;a href=&quot;#{img.public_filename}&quot;&gt;rails.png&lt;/a&gt;},
+                  %{&lt;r:attachment:each offset=&quot;1&quot; by=&quot;filename&quot;&gt;&lt;r:link/&gt;&lt;/r:attachment:each&gt;}, '/'
   end
 
   def test_attachment_inheritance</diff>
      <filename>test/functional/page_attachments_extension_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>33579b03d32a6960e4e4608b6b00d433d309a1ca</id>
    </parent>
  </parents>
  <author>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </author>
  <url>http://github.com/radiant/radiant-page-attachments-extension/commit/4eb43b8ebbcea80803faec2145ce50dcff9b0bff</url>
  <id>4eb43b8ebbcea80803faec2145ce50dcff9b0bff</id>
  <committed-date>2009-06-11T11:20:55-07:00</committed-date>
  <authored-date>2009-06-11T11:20:55-07:00</authored-date>
  <message>Define appropriate behavior in iterator when limit or offset is specified, but not both. Makes the offset attribute more intuitive.

I ran into this bug when trying to use offset but with no limit.  Took me a long time to figure out I had to specify a limit to get offset to work, but I didn't want a limit.</message>
  <tree>c7a7c2fe695266843cb235ce788cf4c11798d799</tree>
  <committer>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </committer>
</commit>
