Permalink
Browse files

Merged croakers branch

  • Loading branch information...
1 parent bf266c5 commit dc934234f84ba48bc1eb3024d24f302c93f7fce5 Ben Johnson committed Sep 13, 2008
Showing with 14 additions and 9 deletions.
  1. +1 −0 .gitignore
  2. +3 −2 README.rdoc
  3. +1 −2 config/environment.rb
  4. +0 −3 config/routes.rb
  5. +9 −2 vendor/plugins/searchgasm-1.0.2/lib/searchgasm/search/base.rb
View
@@ -4,3 +4,4 @@ tmp/*
log/*
.DS_Store
config/deploy.rb
+*.sqlite3
View
@@ -3,7 +3,8 @@
This is an example of how to use Searchgasm in a rails app. Searchgasm is simple searching, ordering, and pagination all in one plugin.
Checkout Searchgasm here: http://github.com/binarylogic/searchgasm
-Quick tutoiral on how to build this application here: http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm
+
+Quick tutorial on how to build this application here: http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm
=== Key files
@@ -31,4 +32,4 @@ After you have set up the gems and migrated your database you can generate the d
The populate task will create 8 user groups with 0 to 150 users each. Each user can have upto 7 orders. (see lib/tasks/populate.rb)
-Copyright (c) 2008 [Ben Johnson](http://github.com/binarylogic) of [Binary Logic](http://www.binarylogic.com), released under the MIT license
+Copyright (c) 2008 {Ben Johnson}[http://github.com/binarylogic] of {Binary Logic}[http://www.binarylogic.com], released under the MIT license
View
@@ -25,7 +25,6 @@
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "aws-s3", :lib => "aws/s3"
- #config.gem :searchgasm
config.gem "populator", :version => ">=0.2.4"
config.gem "faker", :version => ">=0.3.1"
@@ -48,7 +47,7 @@
#if RAILS_ENV == "development" # putting this in environments/development.rb doesn't work, not sure why
# config.plugin_paths = ["#{RAILS_ROOT}/../../Ruby Libs"]
- # config.plugins = [:searchgasm, :each_with_info]
+ # config.plugins = [:searchgasm]
# require "ruby-debug"
#end
View
@@ -7,9 +7,6 @@
map.namespace :rails_ajax do |namespace|
namespace.resources :users
end
- map.namespace :prototype do |namespace|
- namespace.resources :users
- end
map.namespace :jquery do |namespace|
namespace.resources :users
end
@@ -83,8 +83,15 @@ def acting_as_filter?
# 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| "#{name}: #{send(name)}" }.join(", ")
- "#<#{klass} #{options_as_nice_string}>"
+ current_find_options = {}
+ (::ActiveRecord::Base.valid_find_options - [:conditions]).collect do |option|
+ value = send(option)
+ next if value.nil?
+ current_find_options[option] = value
+ end
+ conditions_hash = conditions.conditions
+ current_find_options[:conditions] = conditions_hash if !conditions_hash.blank?
+ "#<#{klass}Search #{current_find_options.inspect}>"
end
def limit=(value)

0 comments on commit dc93423

Please sign in to comment.