<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,3 +3,4 @@
 pkg/*
 coverage/*
 doc/*
+benchmarks/*</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,12 @@
+== 1.0.3 released 2008-09-14
+
+* Updated inspect to show the current options for your search. Plays nicer in the console.
+* Made sure protection state is persistent among relationship conditions.
+
 == 1.0.2 released 2008-09-12
 
 * Moved cached searchers out of the global namespace and into the Searchgasm::Cache namespce.
-* Various changes to improve performance. Added in benchmark reports in readme as well as a benchmarks directory.
+* Various changes to improve performance through profiling / benchmarking. http://pastie.org/271936
 * Config.per_page works with new_search &amp; new_search! only. Where as before it was only working if the search was protected.
 
 == 1.0.1 released 2008-09-11
@@ -50,7 +55,7 @@
 == 0.9.4 released 2008-09-03
 
 * Cleaned up search methods
-* Removed reset!method for both searching and searching by conditions
+* Removed reset! method for both searching and searching by conditions
 
 == 0.9.3 released 2008-09-02
 </diff>
      <filename>CHANGELOG.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -330,21 +330,6 @@ Pretty nifty, huh? You can create any condition ultimately creating any SQL you
 
 I'm a big fan of understanding what I'm using, so here's a quick explanation: The design behind this plugin is pretty simple. The search object &quot;sanitizes&quot; down into the options passed into ActiveRecord::Base.find(). It serves as a transparent filter between you and ActiveRecord::Base.find(). This filter provides &quot;enhancements&quot; that get translated into options that ActiveRecord::Base.find() can understand. It doesn't dig into the ActiveRecord internals, it only uses what is publicly available. It jumps in and helps out &lt;em&gt;only&lt;/em&gt; when needed, otherwise it sits back and lets ActiveRecord do all of the work. Between that and the extensive tests, this is a solid and fast plugin.
 
-== Performance / Benchmarking
-
-I ran searchgasm through some performance tests using ruby-prof. After working on it for a little while I improved performance quite a bit. Notice the &quot;2nd instantiation&quot; report. This is implementing caching and skips all dynamic method creation / meta programming. It resulted in code over 50 times faster.
-
-	                          user     system      total        real
-	1st instantiation:    0.000000   0.000000   0.000000 (  0.005466)
-	2nd instantiation:    0.000000   0.000000   0.000000 (  0.000108)
-	Local ordering:       0.000000   0.000000   0.000000 (  0.000265)
-	Advanced ordering:    0.000000   0.000000   0.000000 (  0.000413)
-	Local conditions:     0.000000   0.000000   0.000000 (  0.000241)
-	Advanced conditions:  0.000000   0.000000   0.000000 (  0.000602)
-	Its complicated:      0.000000   0.000000   0.000000 (  0.001017)
-
-I also included the benchmarking file in benchmarks/benchmark.rb to see for yourself.
-
 == Reporting problems / bugs
 
 http://binarylogic.lighthouseapp.com/projects/16601-searchgasm</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ Echoe.new 'searchgasm' do |p|
   p.email  = 'bjohnson@binarylogic.com'
   p.project = 'searchgasm'
   p.summary = &quot;Orgasmic ActiveRecord searching&quot;
-  p.description = &quot;Makes ActiveRecord searching easier, robust, and powerful. Automatic conditions, pagination support, object based searching, and more.&quot;
+  p.description = &quot;Object based ActiveRecord searching, ordering, pagination, and more!&quot;
   p.url = &quot;http://github.com/binarylogic/searchgasm&quot;
   p.dependencies = %w(activerecord activesupport)
   p.include_rakefile = true</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -125,6 +125,12 @@ module Searchgasm
         i.blank? ? nil : (i.size == 1 ? i.first : i)
       end
       
+      def inspect
+        conditions_hash = conditions
+        conditions_hash[:protected] = true if protected?
+        conditions_hash.inspect
+      end
+      
       # Sanitizes the conditions down into conditions that ActiveRecord::Base.find can understand.
       def sanitize
         conditions = merge_conditions(*objects.collect { |object| object.sanitize })
@@ -171,8 +177,9 @@ module Searchgasm
             self.class.class_eval &lt;&lt;-&quot;end_eval&quot;, __FILE__, __LINE__
               def #{association.name}
                 if @#{association.name}.nil?
-                  @#{association.name} = #{association.class_name}.new_conditions
+                  @#{association.name} = Searchgasm::Conditions::Base.create_virtual_class(#{association.class_name}).new
                   @#{association.name}.relationship_name = &quot;#{association.name}&quot;
+                  @#{association.name}.protect = protect
                   objects &lt;&lt; @#{association.name}
                 end
                 @#{association.name}</diff>
      <filename>lib/searchgasm/conditions/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ module Searchgasm
     module Protection
       def self.included(klass)
         klass.class_eval do
-          attr_accessor :protect
+          attr_reader :protect
           alias_method_chain :conditions=, :protection
         end
       end
@@ -22,6 +22,11 @@ module Searchgasm
         self.conditions_without_protection = conditions
       end
       
+      def protect=(value)
+        associations.each { |association| association.protect = value }
+        @protect = value
+      end
+      
       def protect?
         protect == true
       end</diff>
      <filename>lib/searchgasm/conditions/protection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,9 @@
 module Searchgasm
   module Helpers
     module ControlTypes
+      # = Links Control Types
+      #
+      # These helpers create a group of links to help navigate through search data.
       module Links
         # Creates a group of links that order the data by a column or columns. All that this does is loop through the :choices option and call order_by_link and then glue it all together.
         #
@@ -11,7 +14,7 @@ module Searchgasm
         #
         # === Options
         #
-        # Please look at order_by_link. All options there are applicable here and are passed onto each option.
+        # Please look at order_by_link. All options there are applicable here and are passed onto each option. Here are the options specific to this method:
         #
         # * &lt;tt&gt;:choices&lt;/tt&gt; -- default: the models column names, the choices to loop through when calling order_by_link
         def order_by_links(options = {})
@@ -32,7 +35,7 @@ module Searchgasm
         #
         # === Options
         #
-        # Please look at order_as_link. All options there are applicable here and are passed onto each option.
+        # Please look at order_as_link. All options there are applicable here and are passed onto each option. Here are the options specific to this method:
         #
         # * &lt;tt&gt;:choices&lt;/tt&gt; -- default: [&quot;asc&quot;, &quot;desc&quot;], the choices to loop through when calling order_as_link
         def order_as_links(options = {})
@@ -53,7 +56,7 @@ module Searchgasm
         #
         # === Options
         #
-        # Please look at per_page_link. All options there are applicable here and are passed onto each option.
+        # Please look at per_page_link. All options there are applicable here and are passed onto each option. Here are the options specific to this method:
         #
         # * &lt;tt&gt;:choices&lt;/tt&gt; -- default: [10, 25, 50, 100, 150, 200, nil], the choices to loop through when calling per_page_link.
         def per_page_links(options = {})
@@ -88,11 +91,11 @@ module Searchgasm
         #
         # === Options
         #
-        # Please look at per_page_link. All options there are applicable here and are passed onto each option.
+        # Please look at per_page_link. All options there are applicable here and are passed onto each option. Here are the options specific to this method:
         #
         # * &lt;tt&gt;:spread&lt;/tt&gt; -- default: 3, set to nil to show all page, this represents how many choices available on each side of the current page
-        # * &lt;tt&gt;:prev&lt;/tt&gt; -- default: &lt; Prev, set to nil to omit. This is an extra link on the left side of the page links that will go to the previous page
-        # * &lt;tt&gt;:next&lt;/tt&gt; -- default: Next &gt;, set to nil to omit. This is an extra link on the right side of the page links that will go to the next page
+        # * &lt;tt&gt;:prev&lt;/tt&gt; -- default: &quot;&lt; Prev&quot;, set to nil to omit. This is an extra link on the left side of the page links that will go to the previous page
+        # * &lt;tt&gt;:next&lt;/tt&gt; -- default: &quot;Next &gt;&quot;, set to nil to omit. This is an extra link on the right side of the page links that will go to the next page
         # * &lt;tt&gt;:first&lt;/tt&gt; -- default: nil, set to nil to omit. This is an extra link on thefar left side of the page links that will go to the first page
         # * &lt;tt&gt;:last&lt;/tt&gt; -- default: nil, set to nil to omit. This is an extra link on the far right side of the page links that will go to the last page
         def page_links(options = {})</diff>
      <filename>lib/searchgasm/helpers/control_types/links.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,9 @@
 module Searchgasm
   module Helpers
     module ControlTypes
+      # = Remote Links Control Types
+      #
+      # These helpers use rails built in remote_function as links. They are the same thing as the Links control type, but just use rails built in remote helpers.
       module RemoteLinks
         # Same as order_by_links, but uses link_to_remote instead of remote.
         #</diff>
      <filename>lib/searchgasm/helpers/control_types/remote_links.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,9 @@
 module Searchgasm
   module Helpers
     module ControlTypes
+      # = Remote Select Control Types
+      #
+      # These helpers use rails built in remote_function as links. They are the same thing as the Select control type, but just use rails built in remote helpers.
       module RemoteSelect
         # Please see order_by_links. All options are the same and applicable here. The only difference is that instead of a group of links, this gets returned as a select form element that will perform the same function when the value is changed.
         def remote_order_by_select(options = {})</diff>
      <filename>lib/searchgasm/helpers/control_types/remote_select.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,9 @@
 module Searchgasm
   module Helpers
     module ControlTypes
+      # = Select Control Types
+      #
+      # These create &lt;select&gt; tags to help navigate through search data. This is here as an alternative to the Links control types.
       module Select
         # Please see order_by_links. All options are the same and applicable here. The only difference is that instead of a group of links, this gets returned as a select form element that will perform the same function when the value is changed.
         def order_by_select(options = {})</diff>
      <filename>lib/searchgasm/helpers/control_types/select.rb</filename>
    </modified>
    <modified>
      <diff>@@ -83,8 +83,13 @@ module Searchgasm #:nodoc:
       
       # Makes using searchgasm in the console less annoying and keeps the output meaningful and useful
       def inspect
-        options_as_nice_string = ::ActiveRecord::Base.valid_find_options.collect { |name| &quot;#{name}: #{send(name)}&quot; }.join(&quot;, &quot;)
-        &quot;#&lt;#{klass} #{options_as_nice_string}&gt;&quot;
+        current_find_options = {}
+        ::ActiveRecord::Base.valid_find_options.each do |option|
+          value = send(option)
+          next if value.nil?
+          current_find_options[option] = value
+        end
+        &quot;#&lt;#{klass}Search #{current_find_options.inspect}&gt;&quot;
       end
       
       def limit=(value)</diff>
      <filename>lib/searchgasm/search/base.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>benchmarks/benchmark.rb</filename>
    </removed>
    <removed>
      <filename>benchmarks/benchmark_helper.rb</filename>
    </removed>
    <removed>
      <filename>benchmarks/profile.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>07f8a72fefa39eeac59ca30c7fc02091d2f875da</id>
    </parent>
  </parents>
  <author>
    <name>binarylogic</name>
    <email>bjohnson@binarylogic.com</email>
  </author>
  <url>http://github.com/binarylogic/searchlogic/commit/e3d7cd5959cbe87ca8b20593826e9bd175910f33</url>
  <id>e3d7cd5959cbe87ca8b20593826e9bd175910f33</id>
  <committed-date>2008-09-14T02:00:35-07:00</committed-date>
  <authored-date>2008-09-14T02:00:35-07:00</authored-date>
  <message>Improved inspect and made protection persistent among associated conditions.</message>
  <tree>29b7e207c3570038de9793612d16af354de14a63</tree>
  <committer>
    <name>binarylogic</name>
    <email>bjohnson@binarylogic.com</email>
  </committer>
</commit>
