Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated searchlogic

  • Loading branch information...
commit 68c01e77bea46d9586c4fdea21b0e885618a7660 1 parent f9b6cfb
@binarylogic authored
Showing with 803 additions and 794 deletions.
  1. +5 −5 README.rdoc
  2. +1 −1  app/views/jquery/users/index.html.erb
  3. +7 −7 app/views/layouts/application.html.erb
  4. +1 −1  app/views/non_ajax/users/index.html.erb
  5. +1 −1  app/views/rails_ajax/users/index.html.erb
  6. +3 −3 config/database.example.yml
  7. +2 −2 config/environment.rb
  8. +3 −3 config/initializers/searchgasm.rb
  9. +0 −125 vendor/plugins/searchgasm/Manifest
  10. +0 −4 vendor/plugins/searchgasm/examples/README.rdoc
  11. +0 −1  vendor/plugins/searchgasm/init.rb
  12. +0 −52 vendor/plugins/searchgasm/test/test_condition_base.rb
  13. +0 −137 vendor/plugins/searchgasm/test/test_condition_types.rb
  14. 0  vendor/plugins/{searchgasm → searchlogic}/.gitignore
  15. +16 −15 vendor/plugins/{searchgasm → searchlogic}/CHANGELOG.rdoc
  16. 0  vendor/plugins/{searchgasm → searchlogic}/MIT-LICENSE
  17. +123 −0 vendor/plugins/searchlogic/Manifest
  18. +22 −22 vendor/plugins/{searchgasm → searchlogic}/README.rdoc
  19. +5 −5 vendor/plugins/{searchgasm → searchlogic}/Rakefile
  20. 0  vendor/plugins/{searchgasm → searchlogic}/TODO.rdoc
  21. +4 −0 vendor/plugins/searchlogic/examples/README.rdoc
  22. +1 −0  vendor/plugins/searchlogic/init.rb
  23. +34 −34 vendor/plugins/{searchgasm/lib/searchgasm.rb → searchlogic/lib/searchlogic.rb}
  24. +15 −15 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/active_record/associations.rb
  25. +29 −29 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/active_record/base.rb
  26. +2 −2 ...hgasm/lib/searchgasm → searchlogic/lib/searchlogic}/active_record/connection_adapters/mysql_adapter.rb
  27. +2 −2 .../lib/searchgasm → searchlogic/lib/searchlogic}/active_record/connection_adapters/postgresql_adapter.rb
  28. +2 −2 ...gasm/lib/searchgasm → searchlogic/lib/searchlogic}/active_record/connection_adapters/sqlite_adapter.rb
  29. +4 −4 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/base.rb
  30. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/begins_with.rb
  31. +3 −3 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/blank.rb
  32. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/child_of.rb
  33. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/descendant_of.rb
  34. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/ends_with.rb
  35. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/equals.rb
  36. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/greater_than.rb
  37. +1 −1  ...lugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/greater_than_or_equal_to.rb
  38. +1 −1  ...plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/inclusive_descendant_of.rb
  39. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/keywords.rb
  40. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/less_than.rb
  41. +1 −1  ...r/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/less_than_or_equal_to.rb
  42. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/like.rb
  43. +3 −3 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/nil.rb
  44. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/not_begin_with.rb
  45. +3 −1 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/not_blank.rb
  46. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/not_end_with.rb
  47. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/not_equal.rb
  48. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/not_have_keywords.rb
  49. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/not_like.rb
  50. +3 −1 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/not_nil.rb
  51. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/sibling_of.rb
  52. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/condition/tree.rb
  53. +13 −13 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/conditions/base.rb
  54. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/conditions/protection.rb
  55. +5 −5 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/config.rb
  56. +6 −6 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/config/helpers.rb
  57. +6 −6 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/config/search.rb
  58. +2 −2 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/core_ext/hash.rb
  59. +27 −27 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/control_types/link.rb
  60. +11 −11 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/control_types/links.rb
  61. +2 −2 ...plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/control_types/remote_link.rb
  62. +2 −2 ...lugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/control_types/remote_links.rb
  63. +2 −2 ...ugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/control_types/remote_select.rb
  64. +16 −16 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/control_types/select.rb
  65. +47 −47 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/form.rb
  66. +31 −31 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/helpers/utilities.rb
  67. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/absolute.rb
  68. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/acos.rb
  69. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/asin.rb
  70. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/atan.rb
  71. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/base.rb
  72. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/ceil.rb
  73. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/char_length.rb
  74. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/cos.rb
  75. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/cot.rb
  76. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/day_of_month.rb
  77. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/day_of_week.rb
  78. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/day_of_year.rb
  79. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/degrees.rb
  80. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/exp.rb
  81. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/floor.rb
  82. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/hex.rb
  83. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/hour.rb
  84. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/log.rb
  85. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/log10.rb
  86. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/log2.rb
  87. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/lower.rb
  88. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/ltrim.rb
  89. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/md5.rb
  90. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/microseconds.rb
  91. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/milliseconds.rb
  92. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/minute.rb
  93. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/month.rb
  94. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/octal.rb
  95. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/radians.rb
  96. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/round.rb
  97. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/rtrim.rb
  98. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/second.rb
  99. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/sign.rb
  100. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/sin.rb
  101. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/square_root.rb
  102. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/tan.rb
  103. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/trim.rb
  104. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/upper.rb
  105. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/week.rb
  106. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/modifiers/year.rb
  107. +11 −11 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/search/base.rb
  108. +6 −6 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/search/conditions.rb
  109. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/search/ordering.rb
  110. +3 −3 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/search/pagination.rb
  111. +2 −2 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/search/protection.rb
  112. +3 −3 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/search/searching.rb
  113. +1 −1  vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/shared/utilities.rb
  114. +4 −4 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/shared/virtual_classes.rb
  115. +2 −2 vendor/plugins/{searchgasm/lib/searchgasm → searchlogic/lib/searchlogic}/version.rb
  116. 0  vendor/plugins/{searchgasm → searchlogic}/test/fixtures/accounts.yml
  117. 0  vendor/plugins/{searchgasm → searchlogic}/test/fixtures/cats.yml
  118. 0  vendor/plugins/{searchgasm → searchlogic}/test/fixtures/dogs.yml
  119. 0  vendor/plugins/{searchgasm → searchlogic}/test/fixtures/orders.yml
  120. 0  vendor/plugins/{searchgasm → searchlogic}/test/fixtures/user_groups.yml
  121. 0  vendor/plugins/{searchgasm → searchlogic}/test/fixtures/users.yml
  122. +3 −3 vendor/plugins/{searchgasm → searchlogic}/test/test_active_record_associations.rb
  123. +3 −3 vendor/plugins/{searchgasm → searchlogic}/test/test_active_record_base.rb
  124. +52 −0 vendor/plugins/searchlogic/test/test_condition_base.rb
  125. +143 −0 vendor/plugins/searchlogic/test/test_condition_types.rb
  126. +30 −30 vendor/plugins/{searchgasm → searchlogic}/test/test_conditions_base.rb
  127. 0  vendor/plugins/{searchgasm → searchlogic}/test/test_conditions_protection.rb
  128. +2 −2 vendor/plugins/{searchgasm → searchlogic}/test/test_config.rb
  129. +1 −1  vendor/plugins/{searchgasm → searchlogic}/test/test_helper.rb
  130. +5 −5 vendor/plugins/{searchgasm → searchlogic}/test/test_search_base.rb
  131. +2 −2 vendor/plugins/{searchgasm → searchlogic}/test/test_search_conditions.rb
  132. 0  vendor/plugins/{searchgasm → searchlogic}/test/test_search_ordering.rb
  133. +1 −1  vendor/plugins/{searchgasm → searchlogic}/test/test_search_pagination.rb
  134. +4 −4 vendor/plugins/{searchgasm → searchlogic}/test/test_search_protection.rb
  135. 0  vendor/plugins/{searchgasm → searchlogic}/test_libs/acts_as_tree.rb
  136. 0  vendor/plugins/{searchgasm → searchlogic}/test_libs/ordered_hash.rb
  137. 0  vendor/plugins/{searchgasm → searchlogic}/test_libs/rexml_fix.rb
View
10 README.rdoc
@@ -1,19 +1,19 @@
-= Searchgasm Example
+= Searchlogic Example
-This is an example of how to use Searchgasm in a rails app. Searchgasm is simple searching, ordering, and pagination all in one plugin.
+This is an example of how to use Searchlogic in a rails app. Searchlogic is simple searching, ordering, and pagination all in one plugin.
-This application live: http://searchgasm_example.binarylogic.com
+This application live: http://searchlogic_example.binarylogic.com
Quick tutorial on how to build this application here: http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm
-Searchgasm: http://github.com/binarylogic/searchgasm
+Searchlogic: http://github.com/binarylogic/searchlogic
=== Key files
Here are the files you want to glance at:
1. All of the controllers and their respective views
-2. config/initializers/searchgasm.rb
+2. config/initializers/searchlogic.rb
=== Generate Test Data
View
2  app/views/jquery/users/index.html.erb
@@ -15,7 +15,7 @@ This is the preferred method. Really nice, check out jquery_setup.js on how to s
<%= users.text_field :first_name_keywords %><br />
<br />
- <%= users.label :first_name_sounds_like, "First name sounds like: (try &quot;bin&quot;, this is a custom condition, checkout config/initializers/searchgasm.rb)" %><br />
+ <%= users.label :first_name_sounds_like, "First name sounds like: (try &quot;bin&quot;, this is a custom condition, checkout config/initializers/searchlogic.rb)" %><br />
<%= users.text_field :first_name_sounds_like %><br />
<br />
View
14 app/views/layouts/application.html.erb
@@ -1,6 +1,6 @@
<html>
<head>
- <title>Searchgasm Example</title>
+ <title>Searchlogic Example</title>
<% if controller.controller_path == "jquery/users" %>
<%= javascript_include_tag "jquery.min", "jquery.livequery", "jquery.form", "jquery_setup" %>
<% else %>
@@ -9,13 +9,13 @@
<%= stylesheet_link_tag "application" %>
</head>
<body>
- <h1 style="font-size: 1.5em">Searchgasm example</h1>
- This is a simple / plain example of how to implement searching, ordering, and pagination using Searchgasm into a rails application. Here are some helpful links:<br />
+ <h1 style="font-size: 1.5em">Searchlogic example</h1>
+ This is a simple / plain example of how to implement searching, ordering, and pagination using Searchlogic into a rails application. Here are some helpful links:<br />
<br />
- <%= link_to "source code for this example", "http://github.com/binarylogic/searchgasm_example" %>&nbsp;&nbsp;|&nbsp;&nbsp;
- <%= link_to "tutorial on this example", "http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm" %>&nbsp;&nbsp;|&nbsp;&nbsp;
- <%= link_to "searchgasm repository", "http://github.com/binarylogic/searchgasm" %>&nbsp;&nbsp;|&nbsp;&nbsp;
- <%= link_to "searchgasm docs", "http://searchgasm.rubyforge.org" %>
+ <%= link_to "source code for this example", "http://github.com/binarylogic/searchlogic_example" %>&nbsp;&nbsp;|&nbsp;&nbsp;
+ <%= link_to "tutorial on this example", "http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchlogic" %>&nbsp;&nbsp;|&nbsp;&nbsp;
+ <%= link_to "searchlogic repository", "http://github.com/binarylogic/searchlogic" %>&nbsp;&nbsp;|&nbsp;&nbsp;
+ <%= link_to "searchlogic docs", "http://searchlogic.rubyforge.org" %>
<br />
<br />
<strong>
View
2  app/views/non_ajax/users/index.html.erb
@@ -15,7 +15,7 @@ Good ol' regular http requests.
<%= users.text_field :first_name_keywords %><br />
<br />
- <%= users.label :first_name_sounds_like, "First name sounds like: (try &quot;bin&quot;, this is a custom condition, checkout config/initializers/searchgasm.rb)" %><br />
+ <%= users.label :first_name_sounds_like, "First name sounds like: (try &quot;bin&quot;, this is a custom condition, checkout config/initializers/searchlogic.rb)" %><br />
<%= users.text_field :first_name_sounds_like %><br />
<br />
View
2  app/views/rails_ajax/users/index.html.erb
@@ -17,7 +17,7 @@ If you are wanting to do unobtrusive javascript take a look at the jQuery exampl
<%= users.text_field :first_name_keywords %><br />
<br />
- <%= users.label :first_name_sounds_like, "First name sounds like: (try &quot;bin&quot;, this is a custom condition, checkout config/initializers/searchgasm.rb)" %><br />
+ <%= users.label :first_name_sounds_like, "First name sounds like: (try &quot;bin&quot;, this is a custom condition, checkout config/initializers/searchlogic.rb)" %><br />
<%= users.text_field :first_name_sounds_like %><br />
<br />
View
6 config/database.example.yml
@@ -3,15 +3,15 @@ login: &login
development:
adapter: mysql
- database: searchgasm_development
+ database: searchlogic_development
<<: *login
test:
adapter: mysql
- database: searchgasm_test
+ database: searchlogic_test
<<: *login
production:
adapter: mysql
- database: searchgasm_production
+ database: searchlogic_production
<<: *login
View
4 config/environment.rb
@@ -47,7 +47,7 @@
#if RAILS_ENV == "development" # putting this in environments/development.rb doesn't work, not sure why
# config.plugin_paths += ["#{RAILS_ROOT}/../../Libs"]
- # config.plugins = [:searchgasm]
+ # config.plugins = [:searchlogic]
# require "ruby-debug"
#end
@@ -56,7 +56,7 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
#config.action_controller.session = {
- # :session_key => '_searchgasm_example_session',
+ # :session_key => '_searchlogic_example_session',
# :secret => '4d7db02f53d3bccd73428357072797fb6b04507ad3ef08f0abc589c2f1a6ee8f10e71bdbbc357f8fd50a7620f4bb433836e18017517a9df9df70c910fa3006c8'
#}
View
6 config/initializers/searchgasm.rb
@@ -1,10 +1,10 @@
# Confugration
-Searchgasm::Config.configure do |config|
+Searchlogic::Config.configure do |config|
config.search.per_page = config.helpers.per_page_select_choices.first.last # 10
end
# Actual function for MySQL databases only
-class SoundsLike < Searchgasm::Condition::Base
+class SoundsLike < Searchlogic::Condition::Base
class << self
# The name of the conditions. By default its the name of the class, if you want alternate or alias conditions just add them on.
# If you don't want to add aliases you don't even need to define this method
@@ -22,4 +22,4 @@ def to_conditions(value)
end
end
-Searchgasm::Conditions::Base.register_condition(SoundsLike)
+Searchlogic::Conditions::Base.register_condition(SoundsLike)
View
125 vendor/plugins/searchgasm/Manifest
@@ -1,125 +0,0 @@
-CHANGELOG.rdoc
-examples/README.rdoc
-init.rb
-lib/searchgasm/active_record/associations.rb
-lib/searchgasm/active_record/base.rb
-lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb
-lib/searchgasm/active_record/connection_adapters/postgresql_adapter.rb
-lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb
-lib/searchgasm/condition/base.rb
-lib/searchgasm/condition/begins_with.rb
-lib/searchgasm/condition/blank.rb
-lib/searchgasm/condition/child_of.rb
-lib/searchgasm/condition/descendant_of.rb
-lib/searchgasm/condition/ends_with.rb
-lib/searchgasm/condition/equals.rb
-lib/searchgasm/condition/greater_than.rb
-lib/searchgasm/condition/greater_than_or_equal_to.rb
-lib/searchgasm/condition/ilike.rb
-lib/searchgasm/condition/inclusive_descendant_of.rb
-lib/searchgasm/condition/keywords.rb
-lib/searchgasm/condition/less_than.rb
-lib/searchgasm/condition/less_than_or_equal_to.rb
-lib/searchgasm/condition/like.rb
-lib/searchgasm/condition/nil.rb
-lib/searchgasm/condition/not_begin_with.rb
-lib/searchgasm/condition/not_blank.rb
-lib/searchgasm/condition/not_end_with.rb
-lib/searchgasm/condition/not_equal.rb
-lib/searchgasm/condition/not_have_keywords.rb
-lib/searchgasm/condition/not_ilike.rb
-lib/searchgasm/condition/not_like.rb
-lib/searchgasm/condition/not_nil.rb
-lib/searchgasm/condition/sibling_of.rb
-lib/searchgasm/condition/tree.rb
-lib/searchgasm/conditions/base.rb
-lib/searchgasm/conditions/protection.rb
-lib/searchgasm/config/helpers.rb
-lib/searchgasm/config/search.rb
-lib/searchgasm/config.rb
-lib/searchgasm/core_ext/hash.rb
-lib/searchgasm/helpers/control_types/link.rb
-lib/searchgasm/helpers/control_types/links.rb
-lib/searchgasm/helpers/control_types/remote_link.rb
-lib/searchgasm/helpers/control_types/remote_links.rb
-lib/searchgasm/helpers/control_types/remote_select.rb
-lib/searchgasm/helpers/control_types/select.rb
-lib/searchgasm/helpers/form.rb
-lib/searchgasm/helpers/utilities.rb
-lib/searchgasm/modifiers/absolute.rb
-lib/searchgasm/modifiers/acos.rb
-lib/searchgasm/modifiers/asin.rb
-lib/searchgasm/modifiers/atan.rb
-lib/searchgasm/modifiers/base.rb
-lib/searchgasm/modifiers/ceil.rb
-lib/searchgasm/modifiers/char_length.rb
-lib/searchgasm/modifiers/cos.rb
-lib/searchgasm/modifiers/cot.rb
-lib/searchgasm/modifiers/day_of_month.rb
-lib/searchgasm/modifiers/day_of_week.rb
-lib/searchgasm/modifiers/day_of_year.rb
-lib/searchgasm/modifiers/degrees.rb
-lib/searchgasm/modifiers/exp.rb
-lib/searchgasm/modifiers/floor.rb
-lib/searchgasm/modifiers/hex.rb
-lib/searchgasm/modifiers/hour.rb
-lib/searchgasm/modifiers/log.rb
-lib/searchgasm/modifiers/log10.rb
-lib/searchgasm/modifiers/log2.rb
-lib/searchgasm/modifiers/lower.rb
-lib/searchgasm/modifiers/ltrim.rb
-lib/searchgasm/modifiers/md5.rb
-lib/searchgasm/modifiers/microseconds.rb
-lib/searchgasm/modifiers/milliseconds.rb
-lib/searchgasm/modifiers/minute.rb
-lib/searchgasm/modifiers/month.rb
-lib/searchgasm/modifiers/octal.rb
-lib/searchgasm/modifiers/radians.rb
-lib/searchgasm/modifiers/round.rb
-lib/searchgasm/modifiers/rtrim.rb
-lib/searchgasm/modifiers/second.rb
-lib/searchgasm/modifiers/sign.rb
-lib/searchgasm/modifiers/sin.rb
-lib/searchgasm/modifiers/square_root.rb
-lib/searchgasm/modifiers/tan.rb
-lib/searchgasm/modifiers/trim.rb
-lib/searchgasm/modifiers/upper.rb
-lib/searchgasm/modifiers/week.rb
-lib/searchgasm/modifiers/year.rb
-lib/searchgasm/search/base.rb
-lib/searchgasm/search/conditions.rb
-lib/searchgasm/search/ordering.rb
-lib/searchgasm/search/pagination.rb
-lib/searchgasm/search/protection.rb
-lib/searchgasm/search/searching.rb
-lib/searchgasm/shared/utilities.rb
-lib/searchgasm/shared/virtual_classes.rb
-lib/searchgasm/version.rb
-lib/searchgasm.rb
-Manifest
-MIT-LICENSE
-Rakefile
-README.rdoc
-test/fixtures/accounts.yml
-test/fixtures/cats.yml
-test/fixtures/dogs.yml
-test/fixtures/orders.yml
-test/fixtures/user_groups.yml
-test/fixtures/users.yml
-test/test_active_record_associations.rb
-test/test_active_record_base.rb
-test/test_condition_base.rb
-test/test_condition_types.rb
-test/test_conditions_base.rb
-test/test_conditions_protection.rb
-test/test_config.rb
-test/test_helper.rb
-test/test_search_base.rb
-test/test_search_conditions.rb
-test/test_search_ordering.rb
-test/test_search_pagination.rb
-test/test_search_protection.rb
-test_libs/acts_as_tree.rb
-test_libs/ordered_hash.rb
-test_libs/rexml_fix.rb
-TODO.rdoc
View
4 vendor/plugins/searchgasm/examples/README.rdoc
@@ -1,4 +0,0 @@
-=== Live example
-
-* Please see the live example: http://searchgasm_example.binarylogic.com
-* Source / Github project for the example: http://github.com/binarylogic/searchgasm_example.binarylogic.com
View
1  vendor/plugins/searchgasm/init.rb
@@ -1 +0,0 @@
-require File.dirname(__FILE__) << "/lib/searchgasm"
View
52 vendor/plugins/searchgasm/test/test_condition_base.rb
@@ -1,52 +0,0 @@
-require File.dirname(__FILE__) + '/test_helper.rb'
-
-class TestConditionBase < Test::Unit::TestCase
- def test_condition_type_name
- assert_equal "equals", Searchgasm::Condition::Equals.condition_type_name
- assert_equal "keywords", Searchgasm::Condition::Keywords.condition_type_name
- assert_equal "greater_than_or_equal_to", Searchgasm::Condition::GreaterThanOrEqualTo.condition_type_name
- end
-
- def test_ignore_meaningless_value?
- assert !Searchgasm::Condition::Equals.ignore_meaningless_value?
- assert Searchgasm::Condition::Keywords.ignore_meaningless_value?
- assert !Searchgasm::Condition::NotEqual.ignore_meaningless_value?
- end
-
- def test_value_type
- assert_equal nil, Searchgasm::Condition::Equals.value_type
- assert_equal nil, Searchgasm::Condition::Keywords.value_type
- assert_equal :boolean, Searchgasm::Condition::Nil.value_type
- assert_equal :boolean, Searchgasm::Condition::Blank.value_type
- assert_equal nil, Searchgasm::Condition::GreaterThan.value_type
- end
-
- def test_initialize
- condition = Searchgasm::Condition::Keywords.new(Account, :column => Account.columns_hash["name"])
- assert_equal condition.klass, Account
- assert_equal Account.columns_hash["name"], condition.column
-
- condition = Searchgasm::Condition::GreaterThan.new(Account, :column => "id")
- assert_equal Account.columns_hash["id"], condition.column
-
- condition = Searchgasm::Condition::GreaterThan.new(Account, :column => "id", :column_type => :string, :column_sql_format => "some sql")
- assert_equal Account.columns_hash["id"], condition.column
- condition.value = "awesome"
- assert_equal ["some sql > ?", "awesome"], condition.sanitize
- end
-
- def test_explicitly_set_value
- condition = Searchgasm::Condition::Keywords.new(Account, :column => Account.columns_hash["name"])
- assert !condition.explicitly_set_value?
- condition.value = "test"
- assert condition.explicitly_set_value?
- end
-
- def test_sanitize
- # This is tested thoroughly in test_condition_types
- end
-
- def test_value
- # This is tested thoroughly in test_condition_types
- end
-end
View
137 vendor/plugins/searchgasm/test/test_condition_types.rb
@@ -1,137 +0,0 @@
-require File.dirname(__FILE__) + '/test_helper.rb'
-
-class TestConditionTypes < Test::Unit::TestCase
- def test_sanitize
- condition = Searchgasm::Condition::BeginsWith.new(Account, :column => Account.columns_hash["name"])
- condition.value = "Binary"
- assert_equal ["\"accounts\".\"name\" LIKE ?", "Binary%"], condition.sanitize
-
- condition = Searchgasm::Condition::Blank.new(Account, :column => Account.columns_hash["id"])
- condition.value = "true"
- assert_equal "\"accounts\".\"id\" is NULL or \"accounts\".\"id\" = '' or \"accounts\".\"id\" = false", condition.sanitize
-
- condition = Searchgasm::Condition::Blank.new(Account, :column => Account.columns_hash["id"])
- condition.value = "false"
- assert_equal "\"accounts\".\"id\" is NOT NULL and \"accounts\".\"id\" != '' and \"accounts\".\"id\" != false", condition.sanitize
-
- condition = Searchgasm::Condition::Blank.new(Account, :column => Account.columns_hash["id"])
- condition.value = true
- assert_equal "\"accounts\".\"id\" is NULL or \"accounts\".\"id\" = '' or \"accounts\".\"id\" = false", condition.sanitize
-
- condition = Searchgasm::Condition::Blank.new(Account, :column => Account.columns_hash["id"])
- condition.value = false
- assert_equal "\"accounts\".\"id\" is NOT NULL and \"accounts\".\"id\" != '' and \"accounts\".\"id\" != false", condition.sanitize
-
- condition = Searchgasm::Condition::Blank.new(Account, :column => Account.columns_hash["id"])
- condition.value = nil
- assert_equal nil, condition.sanitize
-
- condition = Searchgasm::Condition::Blank.new(Account, :column => Account.columns_hash["id"])
- condition.value = ""
- assert_equal nil, condition.sanitize
-
- condition = Searchgasm::Condition::ChildOf.new(User)
- condition.value = User.first.id
- assert_equal ["\"users\".\"parent_id\" = ?", User.first.id], condition.sanitize
-
- condition = Searchgasm::Condition::ChildOf.new(User)
- condition.value = User.first
- assert_equal ["\"users\".\"parent_id\" = ?", User.first.id], condition.sanitize
-
- condition = Searchgasm::Condition::DescendantOf.new(User)
- condition.value = User.find(1)
- assert_equal ["\"users\".\"id\" = ? OR \"users\".\"id\" = ?", 2, 3], condition.sanitize
-
- condition = Searchgasm::Condition::EndsWith.new(Account, :column => Account.columns_hash["name"])
- condition.value = "Binary"
- assert_equal ["\"accounts\".\"name\" LIKE ?", "%Binary"], condition.sanitize
-
- condition = Searchgasm::Condition::Equals.new(Account, :column => Account.columns_hash["id"])
- condition.value = 12
- assert_equal ["\"accounts\".\"id\" = ?", 12], condition.sanitize
-
- condition = Searchgasm::Condition::Equals.new(Account, :column => Account.columns_hash["id"])
- condition.value = [1,2,3,4]
- assert_equal ["\"accounts\".\"id\" IN (?)", [1, 2, 3, 4]], condition.sanitize
-
- condition = Searchgasm::Condition::Equals.new(Account, :column => Account.columns_hash["id"])
- condition.value = (1..10)
- assert_equal ["\"accounts\".\"id\" BETWEEN ? AND ?", 1, 10], condition.sanitize
-
- condition = Searchgasm::Condition::GreaterThan.new(Account, :column => Account.columns_hash["id"])
- condition.value = 2
- assert_equal ["\"accounts\".\"id\" > ?", 2], condition.sanitize
-
- condition = Searchgasm::Condition::GreaterThanOrEqualTo.new(Account, :column => Account.columns_hash["id"])
- condition.value = 2
- assert_equal ["\"accounts\".\"id\" >= ?", 2], condition.sanitize
-
- condition = Searchgasm::Condition::InclusiveDescendantOf.new(User)
- condition.value = User.find(1)
- assert_equal ["(\"users\".\"id\" = ?) OR (\"users\".\"id\" = ? OR \"users\".\"id\" = ?)", 1, 2, 3], condition.sanitize
-
- condition = Searchgasm::Condition::Like.new(Account, :column => Account.columns_hash["name"])
- condition.value = "Binary and blah"
- assert_equal ["\"accounts\".\"name\" LIKE ?", "%Binary and blah%"], condition.sanitize
-
- condition = Searchgasm::Condition::Nil.new(Account, :column => Account.columns_hash["id"])
- condition.value = true
- assert_equal "\"accounts\".\"id\" is NULL", condition.sanitize
-
- condition = Searchgasm::Condition::Nil.new(Account, :column => Account.columns_hash["id"])
- condition.value = false
- assert_equal "\"accounts\".\"id\" is NOT NULL", condition.sanitize
-
- condition = Searchgasm::Condition::Nil.new(Account, :column => Account.columns_hash["id"])
- condition.value = "true"
- assert_equal "\"accounts\".\"id\" is NULL", condition.sanitize
-
- condition = Searchgasm::Condition::Nil.new(Account, :column => Account.columns_hash["id"])
- condition.value = "false"
- assert_equal "\"accounts\".\"id\" is NOT NULL", condition.sanitize
-
- condition = Searchgasm::Condition::Nil.new(Account, :column => Account.columns_hash["id"])
- condition.value = nil
- assert_equal nil, condition.sanitize
-
- condition = Searchgasm::Condition::Nil.new(Account, :column => Account.columns_hash["id"])
- condition.value = ""
- assert_equal nil, condition.sanitize
-
- condition = Searchgasm::Condition::NotEqual.new(Account, :column => Account.columns_hash["id"])
- condition.value = 12
- assert_equal ["\"accounts\".\"id\" != ?", 12], condition.sanitize
-
- condition = Searchgasm::Condition::NotEqual.new(Account, :column => Account.columns_hash["id"])
- condition.value = [1,2,3,4]
- assert_equal ["\"accounts\".\"id\" NOT IN (?)", [1, 2, 3, 4]], condition.sanitize
-
- condition = Searchgasm::Condition::NotEqual.new(Account, :column => Account.columns_hash["id"])
- condition.value = (1..10)
- assert_equal ["\"accounts\".\"id\" NOT BETWEEN ? AND ?", 1, 10], condition.sanitize
-
- condition = Searchgasm::Condition::Keywords.new(Account, :column => Account.columns_hash["name"])
- condition.value = "freedom yeah, freedom YEAH right"
- assert_equal ["\"accounts\".\"name\" LIKE ? AND \"accounts\".\"name\" LIKE ? AND \"accounts\".\"name\" LIKE ?", "%freedom%", "%yeah%", "%right%"], condition.sanitize
-
- condition = Searchgasm::Condition::Keywords.new(Account, :column => Account.columns_hash["name"])
- condition.value = "%^$*(^$)"
- assert_equal nil, condition.sanitize
-
- condition = Searchgasm::Condition::Keywords.new(Account, :column => Account.columns_hash["name"])
- condition.value = "%^$*(^$) àáâãäåßéèêëìíîïñòóôõöùúûüýÿ"
- assert_equal ["\"accounts\".\"name\" LIKE ?", "%àáâãäåßéèêëìíîïñòóôõöùúûüýÿ%"], condition.sanitize
-
- condition = Searchgasm::Condition::LessThan.new(Account, :column => Account.columns_hash["id"])
- condition.value = 2
- assert_equal ["\"accounts\".\"id\" < ?", 2], condition.sanitize
-
- condition = Searchgasm::Condition::LessThanOrEqualTo.new(Account, :column => Account.columns_hash["id"])
- condition.value = 2
- assert_equal ["\"accounts\".\"id\" <= ?", 2], condition.sanitize
-
- condition = Searchgasm::Condition::SiblingOf.new(User)
- condition.value = User.find(2)
- assert_equal ["(\"users\".\"id\" != ?) AND (\"users\".\"parent_id\" = ?)", 2, 1], condition.sanitize
- end
-end
View
0  vendor/plugins/searchgasm/.gitignore → vendor/plugins/searchlogic/.gitignore
File renamed without changes
View
31 vendor/plugins/searchgasm/CHANGELOG.rdoc → vendor/plugins/searchlogic/CHANGELOG.rdoc
@@ -1,10 +1,11 @@
-== 1.5.3 released 2008-10-21
+== 1.5.3 released 2008-10-30
* Removed ilike conditions and let the like condition determine if it should use like or ilike depending on the connection adapter.
* Fixed bug where the keywords condition was removing foreign characters.
-* Added configuration option for specifying your javascript library, to cut down on the javascript Searchgasm adds into the form helpers
+* Added configuration option for specifying your javascript library, to cut down on the javascript Searchlogic adds into the form helpers
* Fixed bug with "not" conditions to use sanitize method, like it should, instead of to_conditions.
* Only pass :distinct option for the count calculation
+* Fixed not_nil and not_blank conditions to use boolean values configuration option.
== 1.5.2 released 2008-10-21
@@ -41,7 +42,7 @@
== 1.3.5 released 2008-10-08
-* Since joins are now strings, AR doesn't know how to merge them properly. So searchgasm now checks which joins to skip over to avoid conflicts.
+* Since joins are now strings, AR doesn't know how to merge them properly. So searchlogic now checks which joins to skip over to avoid conflicts.
== 1.3.4 released 2008-10-07
@@ -64,7 +65,7 @@
* Fixed bug to allow conditions on local columns
* Apparently ActiveRecord 2.2 doesnt remove duplicates on all joins, need to enforce this for ALL versions of ActiveRecord
* Fixed bug when passing a symbol as the SQL type for condition return types
-* Moved duplicate removal to only apply when searching or calculating from a search object. Anything done in a normal ActiveRecord method should remain untouched and let ActiveRecord handle it. Just like in ActiveRecord if you do a User.all search and pass some :joins, you might get duplicate records. Searchgasm should not change that behavior, unless called from a searchgasm object.
+* Moved duplicate removal to only apply when searching or calculating from a search object. Anything done in a normal ActiveRecord method should remain untouched and let ActiveRecord handle it. Just like in ActiveRecord if you do a User.all search and pass some :joins, you might get duplicate records. Searchlogic should not change that behavior, unless called from a searchlogic object.
* Discard meaningless array values when setting a condition.
* Delete blank strings from mass assignments on conditions.
@@ -76,7 +77,7 @@
== 1.3.0 released 2008-10-02
* Added modifiers into the mix: hour_of_created_at_less_than = 10, etc.
-* Changed how the Searchgasm::Conditions::Base class works. Instead of predefining all methods for all conditions upon instantiation, they are defined as needed via method_missing. Similar to
+* Changed how the Searchlogic::Conditions::Base class works. Instead of predefining all methods for all conditions upon instantiation, they are defined as needed via method_missing. Similar to
ActiveRecord's dynamic finders: User.find_by_name_and_email(name, email). Once the are defined they never hit method_missing again, acts like a cache.
* Altered how values are handled for each condition, meaningless values are ignored completely.
* Added in more "not" conditions: not_like, not_begin_with, not_have_keywords, etc
@@ -88,7 +89,7 @@
* Fixed aliases for lt, lte, gt, and gte.
* Fixed bug when writing conditions on associations via a hash with string keys
* Added Config.remove_duplicates to turn off the "automatic" removing of duplicates if desired.
-* Updated searchgasm_state helper to insert the entire state all at once.
+* Updated searchlogic_state helper to insert the entire state all at once.
* Added CSS class "ordering" to order_by_link if the search is being ordered by that.
== 1.2.1 released 2008-09-25
@@ -98,14 +99,14 @@
* Removed order_as requirement. order_as is optional.
* Added in deep_merge methods for hash, copied over from ActiveSupport 2.1
* Improved order by auto joins to be based off of what order_by returns instead of setting it when setting order_by.
-* Added priority_order_by. Useful if you want to order featured products first and then order as usual. See documentation in Searchgasm::Search::Ordering for more info.
+* Added priority_order_by. Useful if you want to order featured products first and then order as usual. See documentation in Searchlogic::Search::Ordering for more info.
* Added in base64 support for order_by and priority_order_by so that it's value is safe in the URL
* Added priority_order_by_link
== 1.2.0 released 2008-09-24
-* Added searchgasm_params and searchgasm_url helper to use outside of the control type helpers.
-* Added dup and clone methods that work properly for searchgasm objects
+* Added searchlogic_params and searchlogic_url helper to use outside of the control type helpers.
+* Added dup and clone methods that work properly for searchlogic objects
* Fixed bug to remove nil scope values, HABTM likes to add :limit => nil
* Removed unnecessary build_search methods for associations
* Removed support for searching with conditions only. This just made things much more complicated when you can accomplish the same thing by starting a new search and only setting conditions.
@@ -132,13 +133,13 @@
* Updated valid options for searching and performing calculations, fixed some bugs when searching and performing calculations with advanced options.
* Fixed bug in ordering where table name was assumed by the hash. Now assumed by the reflection.
* Added default for per_page, so pagination comes implemented by default
-* On mass assignments blank strings for *any* conditions are ignored. Sometimes blank strings are meaningful for "equals" and "does not equal", those only takes effect if you explicitly call these conditions: search.conditions.name = "". User.new_search(:conditions => {:name => ""}) will be ignored. Also, Searchgasm should never change how ActiveRecord behaves by default. So User.all(:conditions => {:name => ""}) will NOT be ignored.
+* On mass assignments blank strings for *any* conditions are ignored. Sometimes blank strings are meaningful for "equals" and "does not equal", those only takes effect if you explicitly call these conditions: search.conditions.name = "". User.new_search(:conditions => {:name => ""}) will be ignored. Also, Searchlogic should never change how ActiveRecord behaves by default. So User.all(:conditions => {:name => ""}) will NOT be ignored.
== 1.1.0 released 2008-09-18
* Added the options :inner_spread and :outer_spread to the page_links helper. Also added various config options for setting page_links defaults.
* Updated calculation methods to ignore :limit and :offset. AR returns 0 or nil on calculations that provide an offset.
-* Added support to allow for "any" of the conditions, instead of all of them. Joins conditions with "or" instead of "and". See Searchgasm::Conditions::Base or the readme
+* Added support to allow for "any" of the conditions, instead of all of them. Joins conditions with "or" instead of "and". See Searchlogic::Conditions::Base or the readme
== 1.0.4 released 2008-09-18
@@ -151,13 +152,13 @@
* Made sure protection state is persistent among relationship conditions.
* Fixed bug with backwards compatibility of rails. concat requires a proc in older version.
* Defaulted remote control types to use GET requests instead of POST.
-* Completely reengineered integration with ActiveRecord. Searchgasm is properly using scopes letting you do use serachgasm where scope are implemented. @current_users.orders.new_search, etc. If your search is scoped and you want a search object, that search object will represent a new search in the context of those scopes, meaning the scopes get merged into Searchgasm as options.
-* Dropped support for Searchgasm functionality when defining relationships: has_many :order, :conditions => {:total_gt => 100}, will not work anymore. It's a chicken and the egg thing. Searchgasm needs AR constants, some models get loaded before others, therefore the Order model may not have been loaded yet, causing an unknown constant error.
-* Clean up redundant code and moved it into the Searchgasm::Shared namespace.
+* Completely reengineered integration with ActiveRecord. Searchlogic is properly using scopes letting you do use serachgasm where scope are implemented. @current_users.orders.new_search, etc. If your search is scoped and you want a search object, that search object will represent a new search in the context of those scopes, meaning the scopes get merged into Searchlogic as options.
+* Dropped support for Searchlogic functionality when defining relationships: has_many :order, :conditions => {:total_gt => 100}, will not work anymore. It's a chicken and the egg thing. Searchlogic needs AR constants, some models get loaded before others, therefore the Order model may not have been loaded yet, causing an unknown constant error.
+* Clean up redundant code and moved it into the Searchlogic::Shared namespace.
== 1.0.2 released 2008-09-12
-* Moved cached searchers out of the global namespace and into the Searchgasm::Cache namespce.
+* Moved cached searchers out of the global namespace and into the Searchlogic::Cache namespce.
* Various changes to improve performance through profiling / benchmarking. http://pastie.org/271936
* Config.per_page works with new_search & new_search! only. Where as before it was only working if the search was protected.
View
0  vendor/plugins/searchgasm/MIT-LICENSE → vendor/plugins/searchlogic/MIT-LICENSE
File renamed without changes
View
123 vendor/plugins/searchlogic/Manifest
@@ -0,0 +1,123 @@
+CHANGELOG.rdoc
+examples/README.rdoc
+init.rb
+lib/searchlogic/active_record/associations.rb
+lib/searchlogic/active_record/base.rb
+lib/searchlogic/active_record/connection_adapters/mysql_adapter.rb
+lib/searchlogic/active_record/connection_adapters/postgresql_adapter.rb
+lib/searchlogic/active_record/connection_adapters/sqlite_adapter.rb
+lib/searchlogic/condition/base.rb
+lib/searchlogic/condition/begins_with.rb
+lib/searchlogic/condition/blank.rb
+lib/searchlogic/condition/child_of.rb
+lib/searchlogic/condition/descendant_of.rb
+lib/searchlogic/condition/ends_with.rb
+lib/searchlogic/condition/equals.rb
+lib/searchlogic/condition/greater_than.rb
+lib/searchlogic/condition/greater_than_or_equal_to.rb
+lib/searchlogic/condition/inclusive_descendant_of.rb
+lib/searchlogic/condition/keywords.rb
+lib/searchlogic/condition/less_than.rb
+lib/searchlogic/condition/less_than_or_equal_to.rb
+lib/searchlogic/condition/like.rb
+lib/searchlogic/condition/nil.rb
+lib/searchlogic/condition/not_begin_with.rb
+lib/searchlogic/condition/not_blank.rb
+lib/searchlogic/condition/not_end_with.rb
+lib/searchlogic/condition/not_equal.rb
+lib/searchlogic/condition/not_have_keywords.rb
+lib/searchlogic/condition/not_like.rb
+lib/searchlogic/condition/not_nil.rb
+lib/searchlogic/condition/sibling_of.rb
+lib/searchlogic/condition/tree.rb
+lib/searchlogic/conditions/base.rb
+lib/searchlogic/conditions/protection.rb
+lib/searchlogic/config/helpers.rb
+lib/searchlogic/config/search.rb
+lib/searchlogic/config.rb
+lib/searchlogic/core_ext/hash.rb
+lib/searchlogic/helpers/control_types/link.rb
+lib/searchlogic/helpers/control_types/links.rb
+lib/searchlogic/helpers/control_types/remote_link.rb
+lib/searchlogic/helpers/control_types/remote_links.rb
+lib/searchlogic/helpers/control_types/remote_select.rb
+lib/searchlogic/helpers/control_types/select.rb
+lib/searchlogic/helpers/form.rb
+lib/searchlogic/helpers/utilities.rb
+lib/searchlogic/modifiers/absolute.rb
+lib/searchlogic/modifiers/acos.rb
+lib/searchlogic/modifiers/asin.rb
+lib/searchlogic/modifiers/atan.rb
+lib/searchlogic/modifiers/base.rb
+lib/searchlogic/modifiers/ceil.rb
+lib/searchlogic/modifiers/char_length.rb
+lib/searchlogic/modifiers/cos.rb
+lib/searchlogic/modifiers/cot.rb
+lib/searchlogic/modifiers/day_of_month.rb
+lib/searchlogic/modifiers/day_of_week.rb
+lib/searchlogic/modifiers/day_of_year.rb
+lib/searchlogic/modifiers/degrees.rb
+lib/searchlogic/modifiers/exp.rb
+lib/searchlogic/modifiers/floor.rb
+lib/searchlogic/modifiers/hex.rb
+lib/searchlogic/modifiers/hour.rb
+lib/searchlogic/modifiers/log.rb
+lib/searchlogic/modifiers/log10.rb
+lib/searchlogic/modifiers/log2.rb
+lib/searchlogic/modifiers/lower.rb
+lib/searchlogic/modifiers/ltrim.rb
+lib/searchlogic/modifiers/md5.rb
+lib/searchlogic/modifiers/microseconds.rb
+lib/searchlogic/modifiers/milliseconds.rb
+lib/searchlogic/modifiers/minute.rb
+lib/searchlogic/modifiers/month.rb
+lib/searchlogic/modifiers/octal.rb
+lib/searchlogic/modifiers/radians.rb
+lib/searchlogic/modifiers/round.rb
+lib/searchlogic/modifiers/rtrim.rb
+lib/searchlogic/modifiers/second.rb
+lib/searchlogic/modifiers/sign.rb
+lib/searchlogic/modifiers/sin.rb
+lib/searchlogic/modifiers/square_root.rb
+lib/searchlogic/modifiers/tan.rb
+lib/searchlogic/modifiers/trim.rb
+lib/searchlogic/modifiers/upper.rb
+lib/searchlogic/modifiers/week.rb
+lib/searchlogic/modifiers/year.rb
+lib/searchlogic/search/base.rb
+lib/searchlogic/search/conditions.rb
+lib/searchlogic/search/ordering.rb
+lib/searchlogic/search/pagination.rb
+lib/searchlogic/search/protection.rb
+lib/searchlogic/search/searching.rb
+lib/searchlogic/shared/utilities.rb
+lib/searchlogic/shared/virtual_classes.rb
+lib/searchlogic/version.rb
+lib/searchlogic.rb
+Manifest
+MIT-LICENSE
+Rakefile
+README.rdoc
+test/fixtures/accounts.yml
+test/fixtures/cats.yml
+test/fixtures/dogs.yml
+test/fixtures/orders.yml
+test/fixtures/user_groups.yml
+test/fixtures/users.yml
+test/test_active_record_associations.rb
+test/test_active_record_base.rb
+test/test_condition_base.rb
+test/test_condition_types.rb
+test/test_conditions_base.rb
+test/test_conditions_protection.rb
+test/test_config.rb
+test/test_helper.rb
+test/test_search_base.rb
+test/test_search_conditions.rb
+test/test_search_ordering.rb
+test/test_search_pagination.rb
+test/test_search_protection.rb
+test_libs/acts_as_tree.rb
+test_libs/ordered_hash.rb
+test_libs/rexml_fix.rb
+TODO.rdoc
View
44 vendor/plugins/searchgasm/README.rdoc → vendor/plugins/searchlogic/README.rdoc
@@ -1,28 +1,28 @@
-= Searchgasm
+= Searchlogic
-Searchgasm is orgasmic. Maybe not orgasmic, but you will get aroused. So go grab a towel and let's dive in.
+Searchlogic is orgasmic. Maybe not orgasmic, but you will get aroused. So go grab a towel and let's dive in.
-<b>Searchgasm's inspiration comes right from ActiveRecord. ActiveRecord lets you create objects that represent a record in the database, so why can't you create objects that represent searching the database? Now you can! It's searching, ordering, and pagination all in one.</b>
+<b>Searchlogic's inspiration comes right from ActiveRecord. ActiveRecord lets you create objects that represent a record in the database, so why can't you create objects that represent searching the database? Now you can! It's searching, ordering, and pagination all in one.</b>
== Helpful links
-* <b>Documentation:</b> http://searchgasm.rubyforge.org
-* <b>Easy pagination, ordering, and searching tutorial:</b> http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm
-* <b>Live example of the tutorial above (with source):</b> http://searchgasm_example.binarylogic.com
-* <b>Bugs / feature suggestions:</b> http://binarylogic.lighthouseapp.com/projects/16601-searchgasm
+* <b>Documentation:</b> http://searchlogic.rubyforge.org
+* <b>Easy pagination, ordering, and searching tutorial:</b> http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchlogic
+* <b>Live example of the tutorial above (with source):</b> http://searchlogic_example.binarylogic.com
+* <b>Bugs / feature suggestions:</b> http://binarylogic.lighthouseapp.com/projects/16601-searchlogic
== Install and use
- sudo gem install searchgasm
+ sudo gem install searchlogic
For rails
$ cd vendor/plugins
- $ sudo gem unpack searchgasm
+ $ sudo gem unpack searchlogic
Or as a plugin
- script/plugin install git://github.com/binarylogic/searchgasm.git
+ script/plugin install git://github.com/binarylogic/searchlogic.git
Now try out some of the examples below:
@@ -58,9 +58,9 @@ same as above, but object based
In both examples, instead of using the "all" method you could use any search method: first, find(:all), find(:first), count, sum, average, etc, just like ActiveRecord.
-== The beauty of searchgasm, integration into rails
+== The beauty of searchlogic, integration into rails
-Using Searchgasm in rails is the best part, because rails has all kinds of nifty methods to make dealing with ActiveRecord objects quick and easy, especially with forms. So let's take advantage of them! That's the idea behind this plugin. Searchgasm is searching, ordering, and pagination all rolled into one simple plugin. Take all of that pagination and searching cruft out of your models and controllers, and let Searchgasm handle it. Check it out:
+Using Searchlogic in rails is the best part, because rails has all kinds of nifty methods to make dealing with ActiveRecord objects quick and easy, especially with forms. So let's take advantage of them! That's the idea behind this plugin. Searchlogic is searching, ordering, and pagination all rolled into one simple plugin. Take all of that pagination and searching cruft out of your models and controllers, and let Searchlogic handle it. Check it out:
# app/controllers/users_controller.rb
def index
@@ -108,7 +108,7 @@ Things to note in this view:
4. The page_select and per_page_select helpers
5. All of your search logic is in 1 spot: your view. Nice and DRY.
-<b>See my tutorial on this example: http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm</b>
+<b>See my tutorial on this example: http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchlogic</b>
== Exhaustive Example w/ Object Based Searching (great for form_for or fields_for)
@@ -184,7 +184,7 @@ Any of the options used in the above example can be used in these, but for the s
== Match ANY or ALL of the conditions
-As you saw above, the nice thing about Searchgasm is it's integration with forms. I designed the "any" option so that forms can set this as well, just like a condition.
+As you saw above, the nice thing about Searchlogic is it's integration with forms. I designed the "any" option so that forms can set this as well, just like a condition.
search = User.new_search(:conditions => {:age_gt => 18})
search.conditions.first_name_contains = "Ben"
@@ -202,7 +202,7 @@ As you saw above, the nice thing about Searchgasm is it's integration with forms
== Scope support
-Not only can you use searchgasm when searching, but you can use it when using scopes.
+Not only can you use searchlogic when searching, but you can use it when using scopes.
class User < ActiveRecord::Base
named_scope :sexy, :conditions => {:first_name => "Ben", email_ends_with => "binarylogic.com"}, :per_page => 20
@@ -220,7 +220,7 @@ or
== Always use protection...against SQL injections
-If there is one thing we all know, it's to always use protection against SQL injections. That's why searchgasm protects you by default. The new\_search methods protect mass assignments by default (instantiation and search.options = {}). This means that various checks are done to ensure it is not possible to perform any type of SQL injection during mass assignments. But this also limits how you can search, meaning you can't write raw SQL. If you want to be daring and search without protection, all that you have to do is add ! to the end of the method: new\_search!.
+If there is one thing we all know, it's to always use protection against SQL injections. That's why searchlogic protects you by default. The new\_search methods protect mass assignments by default (instantiation and search.options = {}). This means that various checks are done to ensure it is not possible to perform any type of SQL injection during mass assignments. But this also limits how you can search, meaning you can't write raw SQL. If you want to be daring and search without protection, all that you have to do is add ! to the end of the method: new\_search!.
=== Protected from SQL injections
@@ -284,9 +284,9 @@ ActiveRecord does a great job when it comes to keeping your code database agnost
PostgreSQL: date_part('hour', created_at)
SQLite: strftime('%H', created_at)
-All of a sudden your app is not database agnostic. Searchgasm to the rescue! Searchgasm creates what I like to call "modifiers" to handle this nonsense for you. A modifier modifies a column. For example, the hour modifier modifies a datetime column to return the hour.
+All of a sudden your app is not database agnostic. Searchlogic to the rescue! Searchlogic creates what I like to call "modifiers" to handle this nonsense for you. A modifier modifies a column. For example, the hour modifier modifies a datetime column to return the hour.
-The last thing to keep in mind is that <b>not all modifiers are available for every database</b>. MySQL and PostgreSQL support all of these, but SQLite does not. SQLite is nice, in the sense that its really is "lite". The only modifiers it supports are the datetime modifiers. If you want support for the other modifiers you have to write the SQLite function yourself and register the modifier in searchgasm.
+The last thing to keep in mind is that <b>not all modifiers are available for every database</b>. MySQL and PostgreSQL support all of these, but SQLite does not. SQLite is nice, in the sense that its really is "lite". The only modifiers it supports are the datetime modifiers. If you want support for the other modifiers you have to write the SQLite function yourself and register the modifier in searchlogic.
Here are all of the available modifiers:
@@ -359,17 +359,17 @@ http://www.binarylogic.com/2008/10/5/tutorial-caching-virtual-attributes-in-the-
== Roll your own conditions & modifiers
-For more information on this please see Searchgasm::Conditions::Base
+For more information on this please see Searchlogic::Conditions::Base
== Under the hood
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 and I had 1 main rule when developing this:
-ActiveRecord should never know about Searchgasm
+ActiveRecord should never know about Searchlogic
-What that rule means is that any options you pass when searching get "sanitized" down into options ActiveRecord can understand. Searchgasm serves as a transparent filter between you and ActiveRecord. It doesn't dig into the ActiveRecord internals, it only uses what is publicly available. It jumps in and helps out <em>only</em> when needed, otherwise it sits back and stays completely out of the way.
+What that rule means is that any options you pass when searching get "sanitized" down into options ActiveRecord can understand. Searchlogic serves as a transparent filter between you and ActiveRecord. It doesn't dig into the ActiveRecord internals, it only uses what is publicly available. It jumps in and helps out <em>only</em> when needed, otherwise it sits back and stays completely out of the way.
-Lastly, Searchgasm is lazy. It only creates objects, methods, and classes when needed. Once it creates them it caches them. For example, all of the nifty conditions are created via meta programming. The first time you execute something like User.new_search all of that method creation gets cached into Searchgasm::Cache::UserSearch. The next time you execute User.new_search it will be over 50 times faster because it uses the cached class.
+Lastly, Searchlogic is lazy. It only creates objects, methods, and classes when needed. Once it creates them it caches them. For example, all of the nifty conditions are created via meta programming. The first time you execute something like User.new_search all of that method creation gets cached into Searchlogic::Cache::UserSearch. The next time you execute User.new_search it will be over 50 times faster because it uses the cached class.
Between that and the extensive tests, this is a solid and fast plugin.
View
10 vendor/plugins/searchgasm/Rakefile → vendor/plugins/searchlogic/Rakefile
@@ -1,15 +1,15 @@
require 'rubygems'
require 'echoe'
-require File.dirname(__FILE__) << "/lib/searchgasm/version"
+require File.dirname(__FILE__) << "/lib/searchlogic/version"
-Echoe.new 'searchgasm' do |p|
- p.version = Searchgasm::Version::STRING
+Echoe.new 'searchlogic' do |p|
+ p.version = Searchlogic::Version::STRING
p.author = "Ben Johnson of Binary Logic"
p.email = 'bjohnson@binarylogic.com'
- p.project = 'searchgasm'
+ p.project = 'searchlogic'
p.summary = "Object based ActiveRecord searching, ordering, pagination, and more!"
- p.url = "http://github.com/binarylogic/searchgasm"
+ p.url = "http://github.com/binarylogic/searchlogic"
p.dependencies = %w(activerecord activesupport)
p.include_rakefile = true
end
View
0  vendor/plugins/searchgasm/TODO.rdoc → vendor/plugins/searchlogic/TODO.rdoc
File renamed without changes
View
4 vendor/plugins/searchlogic/examples/README.rdoc
@@ -0,0 +1,4 @@
+=== Live example
+
+* Please see the live example: http://searchlogic_example.binarylogic.com
+* Source / Github project for the example: http://github.com/binarylogic/searchlogic_example.binarylogic.com
View
1  vendor/plugins/searchlogic/init.rb
@@ -0,0 +1 @@
+require File.dirname(__FILE__) << "/lib/searchlogic"
View
68 vendor/plugins/searchgasm/lib/searchgasm.rb → vendor/plugins/searchlogic/lib/searchlogic.rb
@@ -7,63 +7,63 @@
["mysql", "postgresql", "sqlite"].each do |adapter_name|
begin
require "active_record/connection_adapters/#{adapter_name}_adapter"
- require "searchgasm/active_record/connection_adapters/#{adapter_name}_adapter"
+ require "searchlogic/active_record/connection_adapters/#{adapter_name}_adapter"
rescue Exception
end
end
# Core Ext
-require "searchgasm/core_ext/hash"
+require "searchlogic/core_ext/hash"
# Shared
-require "searchgasm/shared/utilities"
-require "searchgasm/shared/virtual_classes"
+require "searchlogic/shared/utilities"
+require "searchlogic/shared/virtual_classes"
# Base classes
-require "searchgasm/version"
-require "searchgasm/config/helpers"
-require "searchgasm/config/search"
-require "searchgasm/config"
+require "searchlogic/version"
+require "searchlogic/config/helpers"
+require "searchlogic/config/search"
+require "searchlogic/config"
# ActiveRecord
-require "searchgasm/active_record/base"
-require "searchgasm/active_record/associations"
+require "searchlogic/active_record/base"
+require "searchlogic/active_record/associations"
# Search
-require "searchgasm/search/ordering"
-require "searchgasm/search/pagination"
-require "searchgasm/search/conditions"
-require "searchgasm/search/searching"
-require "searchgasm/search/base"
-require "searchgasm/search/protection"
+require "searchlogic/search/ordering"
+require "searchlogic/search/pagination"
+require "searchlogic/search/conditions"
+require "searchlogic/search/searching"
+require "searchlogic/search/base"
+require "searchlogic/search/protection"
# Conditions
-require "searchgasm/conditions/protection"
-require "searchgasm/conditions/base"
+require "searchlogic/conditions/protection"
+require "searchlogic/conditions/base"
# Condition
-require "searchgasm/condition/base"
-require "searchgasm/condition/tree"
+require "searchlogic/condition/base"
+require "searchlogic/condition/tree"
SEARCHGASM_CONDITIONS = [:begins_with, :blank, :child_of, :descendant_of, :ends_with, :equals, :greater_than, :greater_than_or_equal_to, :inclusive_descendant_of, :like, :nil, :not_begin_with, :not_blank, :not_end_with, :not_equal, :not_have_keywords, :not_nil, :keywords, :less_than, :less_than_or_equal_to, :sibling_of]
-SEARCHGASM_CONDITIONS.each { |condition| require "searchgasm/condition/#{condition}" }
+SEARCHGASM_CONDITIONS.each { |condition| require "searchlogic/condition/#{condition}" }
# Modifiers
-require "searchgasm/modifiers/base"
+require "searchlogic/modifiers/base"
SEARCHGASM_MODIFIERS = [:absolute, :acos, :asin, :atan, :ceil, :char_length, :cos, :cot, :day_of_month, :day_of_week, :day_of_year, :degrees, :exp, :floor, :hex, :hour, :log, :log10, :log2, :lower, :ltrim, :md5, :microseconds, :milliseconds, :minute, :month, :octal, :radians, :round, :rtrim, :second, :sign, :sin, :square_root, :tan, :trim, :upper, :week, :year]
-SEARCHGASM_MODIFIERS.each { |modifier| require "searchgasm/modifiers/#{modifier}" }
+SEARCHGASM_MODIFIERS.each { |modifier| require "searchlogic/modifiers/#{modifier}" }
# Helpers
-require "searchgasm/helpers/utilities"
-require "searchgasm/helpers/form"
-require "searchgasm/helpers/control_types/link"
-require "searchgasm/helpers/control_types/links"
-require "searchgasm/helpers/control_types/select"
-require "searchgasm/helpers/control_types/remote_link"
-require "searchgasm/helpers/control_types/remote_links"
-require "searchgasm/helpers/control_types/remote_select"
+require "searchlogic/helpers/utilities"
+require "searchlogic/helpers/form"
+require "searchlogic/helpers/control_types/link"
+require "searchlogic/helpers/control_types/links"
+require "searchlogic/helpers/control_types/select"
+require "searchlogic/helpers/control_types/remote_link"
+require "searchlogic/helpers/control_types/remote_links"
+require "searchlogic/helpers/control_types/remote_select"
# Lets do it!
-module Searchgasm
+module Searchlogic
module Search
class Base
include Conditions
@@ -79,8 +79,8 @@ class Base
include Protection
end
- SEARCHGASM_CONDITIONS.each { |condition| Base.register_condition("Searchgasm::Condition::#{condition.to_s.camelize}".constantize) }
- SEARCHGASM_MODIFIERS.each { |modifier| Base.register_modifier("Searchgasm::Modifiers::#{modifier.to_s.camelize}".constantize) }
+ SEARCHGASM_CONDITIONS.each { |condition| Base.register_condition("Searchlogic::Condition::#{condition.to_s.camelize}".constantize) }
+ SEARCHGASM_MODIFIERS.each { |modifier| Base.register_modifier("Searchlogic::Modifiers::#{modifier.to_s.camelize}".constantize) }
end
# The namespace I put all cached search classes.
View
30 ...gasm/lib/searchgasm/active_record/associations.rb → ...gic/lib/searchlogic/active_record/associations.rb
@@ -1,23 +1,23 @@
-module Searchgasm
+module Searchlogic
module ActiveRecord
- # = Searchgasm ActiveRecord Associations
+ # = Searchlogic ActiveRecord Associations
#
- # These methods hook into ActiveRecords association methods and add in searchgasm functionality.
+ # These methods hook into ActiveRecords association methods and add in searchlogic functionality.
module Associations
module AssociationCollection
# This needs to be implemented because AR doesn't leverage scopes with this method like it probably should
- def find_with_searchgasm(*args)
+ def find_with_searchlogic(*args)
options = args.extract_options!
- args << filter_options_with_searchgasm(options)
- find_without_searchgasm(*args)
+ args << filter_options_with_searchlogic(options)
+ find_without_searchlogic(*args)
end
end
module HasManyAssociation
- def count_with_searchgasm(*args)
+ def count_with_searchlogic(*args)
options = args.extract_options!
- args << filter_options_with_searchgasm(options)
- count_without_searchgasm(*args)
+ args << filter_options_with_searchlogic(options)
+ count_without_searchlogic(*args)
end
end
end
@@ -26,18 +26,18 @@ def count_with_searchgasm(*args)
ActiveRecord::Associations::AssociationCollection.class_eval do
if respond_to?(:find)
- include Searchgasm::ActiveRecord::Associations::AssociationCollection
- alias_method_chain :find, :searchgasm
+ include Searchlogic::ActiveRecord::Associations::AssociationCollection
+ alias_method_chain :find, :searchlogic
end
end
ActiveRecord::Associations::HasManyAssociation.class_eval do
- include Searchgasm::ActiveRecord::Associations::HasManyAssociation
- alias_method_chain :count, :searchgasm
+ include Searchlogic::ActiveRecord::Associations::HasManyAssociation
+ alias_method_chain :count, :searchlogic
# Older versions of AR have find in here, not in AssociationCollection
- include Searchgasm::ActiveRecord::Associations::AssociationCollection
- alias_method_chain :find, :searchgasm
+ include Searchlogic::ActiveRecord::Associations::AssociationCollection
+ alias_method_chain :find, :searchlogic
end
ActiveRecord::Associations::ClassMethods::InnerJoinDependency::InnerJoinAssociation.class_eval do
View
58 ...s/searchgasm/lib/searchgasm/active_record/base.rb → ...searchlogic/lib/searchlogic/active_record/base.rb
@@ -1,29 +1,29 @@
-module Searchgasm
- # == Searchgasm ActiveRecord
+module Searchlogic
+ # == Searchlogic ActiveRecord
#
- # Hooks into ActiveRecord to add all of the searchgasm functionality into your models. Only uses what is publically available, doesn't dig into internals, and
- # searchgasm only gets involved when needed.
+ # Hooks into ActiveRecord to add all of the searchlogic functionality into your models. Only uses what is publically available, doesn't dig into internals, and
+ # searchlogic only gets involved when needed.
module ActiveRecord
- # = Searchgasm ActiveRecord Base
+ # = Searchlogic ActiveRecord Base
# Adds in base level functionality to ActiveRecord
module Base
- # This is an alias method chain. It hook into ActiveRecord's "calculate" method and checks to see if Searchgasm should get involved.
- def calculate_with_searchgasm(*args)
+ # This is an alias method chain. It hook into ActiveRecord's "calculate" method and checks to see if Searchlogic should get involved.
+ def calculate_with_searchlogic(*args)
options = args.extract_options!
- options = filter_options_with_searchgasm(options, false)
+ options = filter_options_with_searchlogic(options, false)
args << options
- calculate_without_searchgasm(*args)
+ calculate_without_searchlogic(*args)
end
- # This is an alias method chain. It hooks into ActiveRecord's "find" method and checks to see if Searchgasm should get involved.
- def find_with_searchgasm(*args)
+ # This is an alias method chain. It hooks into ActiveRecord's "find" method and checks to see if Searchlogic should get involved.
+ def find_with_searchlogic(*args)
options = args.extract_options!
- options = filter_options_with_searchgasm(options)
+ options = filter_options_with_searchlogic(options)
args << options
- find_without_searchgasm(*args)
+ find_without_searchlogic(*args)
end
- # This is an alias method chain. It hooks into ActiveRecord's scopes and checks to see if Searchgasm should get involved. Allowing you to use all of Searchgasms conditions and tools
+ # This is an alias method chain. It hooks into ActiveRecord's scopes and checks to see if Searchlogic should get involved. Allowing you to use all of Searchlogics conditions and tools
# in scopes as well.
#
# === Examples
@@ -42,12 +42,12 @@ def find_with_searchgasm(*args)
# with_scope(:find => {:conditions => {:total_gt => 1_000_000}, :per_page => 10}) do
# build_search
# end
- def with_scope_with_searchgasm(method_scoping = {}, action = :merge, &block)
- method_scoping[:find] = filter_options_with_searchgasm(method_scoping[:find]) if method_scoping[:find]
- with_scope_without_searchgasm(method_scoping, action, &block)
+ def with_scope_with_searchlogic(method_scoping = {}, action = :merge, &block)
+ method_scoping[:find] = filter_options_with_searchlogic(method_scoping[:find]) if method_scoping[:find]
+ with_scope_without_searchlogic(method_scoping, action, &block)
end
- # This is a special method that Searchgasm adds in. It returns a new search object on the model. So you can search via an object.
+ # This is a special method that Searchlogic adds in. It returns a new search object on the model. So you can search via an object.
#
# <b>This method is "protected". Meaning it checks the passed options for SQL injections. So trying to write raw SQL in *any* of the option will result in a raised exception. It's safe to pass a params object when instantiating.</b>
#
@@ -62,7 +62,7 @@ def with_scope_with_searchgasm(method_scoping = {}, action = :merge, &block)
# search.order_by = {:user_group => :name}
# search.all # can call any search method: first, find(:all), find(:first), sum("id"), etc...
def build_search(options = {}, &block)
- search = searchgasm_search
+ search = searchlogic_search
search.protect = true
search.options = options
yield search if block_given?
@@ -73,7 +73,7 @@ def build_search(options = {}, &block)
#
# This also has an alias "new_search!"
def build_search!(options = {}, &block)
- search = searchgasm_search(options)
+ search = searchlogic_search(options)
yield search if block_given?
search
end
@@ -104,9 +104,9 @@ def accessible_conditions # :nodoc:
end
private
- def filter_options_with_searchgasm(options = {}, searching = true)
- return options unless Searchgasm::Search::Base.needed?(self, options)
- search = Searchgasm::Search::Base.create_virtual_class(self).new # call explicitly to avoid merging the scopes into the search
+ def filter_options_with_searchlogic(options = {}, searching = true)
+ return options unless Searchlogic::Search::Base.needed?(self, options)
+ search = Searchlogic::Search::Base.create_virtual_class(self).new # call explicitly to avoid merging the scopes into the search
search.acting_as_filter = true
search.scope = scope(:find)
conditions = options.delete(:conditions) || options.delete("conditions") || {}
@@ -122,7 +122,7 @@ def filter_options_with_searchgasm(options = {}, searching = true)
search.sanitize(searching)
end
- def searchgasm_search(options = {})
+ def searchlogic_search(options = {})
scope = {}
current_scope = scope(:find) && scope(:find).deep_dup
if current_scope
@@ -137,7 +137,7 @@ def searchgasm_search(options = {})
current_scope.each { |k, v| new_scope[k] = v unless v.nil? }
current_scope = new_scope
end
- search = Searchgasm::Search::Base.create_virtual_class(self).new
+ search = Searchlogic::Search::Base.create_virtual_class(self).new
search.scope = scope
search.options = current_scope
search.options = options
@@ -147,14 +147,14 @@ def searchgasm_search(options = {})
end
end
-ActiveRecord::Base.send(:extend, Searchgasm::ActiveRecord::Base)
+ActiveRecord::Base.send(:extend, Searchlogic::ActiveRecord::Base)
module ActiveRecord #:nodoc: all
class Base
class << self
- alias_method_chain :calculate, :searchgasm
- alias_method_chain :find, :searchgasm
- alias_method_chain :with_scope, :searchgasm
+ alias_method_chain :calculate, :searchlogic
+ alias_method_chain :find, :searchlogic
+ alias_method_chain :with_scope, :searchlogic
alias_method :new_search, :build_search
alias_method :new_search!, :build_search!
View
4 ...ctive_record/connection_adapters/mysql_adapter.rb → ...ctive_record/connection_adapters/mysql_adapter.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module ActiveRecord
module ConnectionAdapters # :nodoc: all
module MysqlAdapter
@@ -169,4 +169,4 @@ def tan_sql(column_name)
end
end
-::ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, Searchgasm::ActiveRecord::ConnectionAdapters::MysqlAdapter)
+::ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, Searchlogic::ActiveRecord::ConnectionAdapters::MysqlAdapter)
View
4 ..._record/connection_adapters/postgresql_adapter.rb → ..._record/connection_adapters/postgresql_adapter.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module ActiveRecord
module ConnectionAdapters
module PostgreSQLAdapter
@@ -165,4 +165,4 @@ def tan_sql(column_name)
end
end
-::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, Searchgasm::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
+::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, Searchlogic::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
View
4 ...tive_record/connection_adapters/sqlite_adapter.rb → ...tive_record/connection_adapters/sqlite_adapter.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module ActiveRecord
module ConnectionAdapters
module SQLiteAdapter
@@ -72,4 +72,4 @@ def upper_sql(column_name)
end
end
-::ActiveRecord::ConnectionAdapters::SQLiteAdapter.send(:include, Searchgasm::ActiveRecord::ConnectionAdapters::SQLiteAdapter)
+::ActiveRecord::ConnectionAdapters::SQLiteAdapter.send(:include, Searchlogic::ActiveRecord::ConnectionAdapters::SQLiteAdapter)
View
8 ...ugins/searchgasm/lib/searchgasm/condition/base.rb → ...ins/searchlogic/lib/searchlogic/condition/base.rb
@@ -1,9 +1,9 @@
-module Searchgasm
+module Searchlogic
module Condition # :nodoc:
# = Conditions condition
#
# The base class for creating a condition. Your custom conditions should extend this class.
- # See Searchgasm::Conditions::Base.register_condition on how to write your own condition.
+ # See Searchlogic::Conditions::Base.register_condition on how to write your own condition.
class Base
include Shared::Utilities
@@ -31,8 +31,8 @@ def join_arrays_with_or?
# Determines what to call the condition for the model
#
- # Searchgasm tries to create conditions on each model. Before it does this it passes the model to this method to see what to call the condition. If the condition type doesnt want to create a condition on
- # a model it will just return nil and Searchgasm will skip over it.
+ # Searchlogic tries to create conditions on each model. Before it does this it passes the model to this method to see what to call the condition. If the condition type doesnt want to create a condition on
+ # a model it will just return nil and Searchlogic will skip over it.
def condition_names_for_model
[]
end
View
2  ...earchgasm/lib/searchgasm/condition/begins_with.rb → ...rchlogic/lib/searchlogic/condition/begins_with.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class BeginsWith < Base
self.join_arrays_with_or = true
View
6 ...gins/searchgasm/lib/searchgasm/condition/blank.rb → ...ns/searchlogic/lib/searchlogic/condition/blank.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class Blank < Base
self.value_type = :boolean
@@ -11,9 +11,9 @@ def condition_names_for_column
def to_conditions(value)
if value == true
- "#{column_sql} is NULL or #{column_sql} = '' or #{column_sql} = false"
+ "#{column_sql} IS NULL or #{column_sql} = '' or #{column_sql} = false"
elsif value == false
- "#{column_sql} is NOT NULL and #{column_sql} != '' and #{column_sql} != false"
+ "#{column_sql} IS NOT NULL and #{column_sql} != '' and #{column_sql} != false"
end
end
end
View
2  ...s/searchgasm/lib/searchgasm/condition/child_of.rb → ...searchlogic/lib/searchlogic/condition/child_of.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class ChildOf < Tree
def to_conditions(value)
View
2  ...rchgasm/lib/searchgasm/condition/descendant_of.rb → ...hlogic/lib/searchlogic/condition/descendant_of.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class DescendantOf < Tree
def to_conditions(value)
View
2  .../searchgasm/lib/searchgasm/condition/ends_with.rb → ...earchlogic/lib/searchlogic/condition/ends_with.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class EndsWith < Base
self.join_arrays_with_or = true
View
2  ...ins/searchgasm/lib/searchgasm/condition/equals.rb → ...s/searchlogic/lib/searchlogic/condition/equals.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class Equals < Base
self.handle_array_value = true
View
2  ...archgasm/lib/searchgasm/condition/greater_than.rb → ...chlogic/lib/searchlogic/condition/greater_than.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class GreaterThan < Base
class << self
View
2  .../searchgasm/condition/greater_than_or_equal_to.rb → ...searchlogic/condition/greater_than_or_equal_to.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class GreaterThanOrEqualTo < Base
class << self
View
2  ...b/searchgasm/condition/inclusive_descendant_of.rb → .../searchlogic/condition/inclusive_descendant_of.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class InclusiveDescendantOf < Tree
def to_conditions(value)
View
2  ...s/searchgasm/lib/searchgasm/condition/keywords.rb → ...searchlogic/lib/searchlogic/condition/keywords.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class Keywords < Base
# Because be default it joins with AND, so padding an array just gives you more options. Joining with and is no different than combining all of the words.
View
2  .../searchgasm/lib/searchgasm/condition/less_than.rb → ...earchlogic/lib/searchlogic/condition/less_than.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class LessThan < Base
class << self
View
2  ...lib/searchgasm/condition/less_than_or_equal_to.rb → ...ib/searchlogic/condition/less_than_or_equal_to.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class LessThanOrEqualTo < Base
class << self
View
2  ...ugins/searchgasm/lib/searchgasm/condition/like.rb → ...ins/searchlogic/lib/searchlogic/condition/like.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class Like < Base
class << self
View
6 ...lugins/searchgasm/lib/searchgasm/condition/nil.rb → ...gins/searchlogic/lib/searchlogic/condition/nil.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class Nil < Base
self.value_type = :boolean
@@ -11,9 +11,9 @@ def condition_names_for_column
def to_conditions(value)
if value == true
- "#{column_sql} is NULL"
+ "#{column_sql} IS NULL"
elsif value == false
- "#{column_sql} is NOT NULL"
+ "#{column_sql} IS NOT NULL"
end
end
end
View
2  ...chgasm/lib/searchgasm/condition/not_begin_with.rb → ...logic/lib/searchlogic/condition/not_begin_with.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class NotBeginWith < Base
class << self
View
4 .../searchgasm/lib/searchgasm/condition/not_blank.rb → ...earchlogic/lib/searchlogic/condition/not_blank.rb
@@ -1,6 +1,8 @@
-module Searchgasm
+module Searchlogic
module Condition
class NotBlank < Base
+ self.value_type = :boolean
+
class << self
def condition_names_for_column
super + ["is_not_blank"]
View
2  ...archgasm/lib/searchgasm/condition/not_end_with.rb → ...chlogic/lib/searchlogic/condition/not_end_with.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class NotEndWith < Base
class << self
View
2  .../searchgasm/lib/searchgasm/condition/not_equal.rb → ...earchlogic/lib/searchlogic/condition/not_equal.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class NotEqual < Base
self.handle_array_value = true
View
2  ...asm/lib/searchgasm/condition/not_have_keywords.rb → ...ic/lib/searchlogic/condition/not_have_keywords.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class NotHaveKeywords < Base
class << self
View
2  ...s/searchgasm/lib/searchgasm/condition/not_like.rb → ...searchlogic/lib/searchlogic/condition/not_like.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class NotLike < Base
class << self
View
4 ...ns/searchgasm/lib/searchgasm/condition/not_nil.rb → .../searchlogic/lib/searchlogic/condition/not_nil.rb
@@ -1,6 +1,8 @@
-module Searchgasm
+module Searchlogic
module Condition
class NotNil < Base
+ self.value_type = :boolean
+
class << self
def condition_names_for_column
super + ["is_not_nil", "is_not_null", "not_null"]
View
2  ...searchgasm/lib/searchgasm/condition/sibling_of.rb → ...archlogic/lib/searchlogic/condition/sibling_of.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class SiblingOf < Tree
def to_conditions(value)
View
2  ...ugins/searchgasm/lib/searchgasm/condition/tree.rb → ...ins/searchlogic/lib/searchlogic/condition/tree.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Condition
class Tree < Base # :nodoc:
self.join_arrays_with_or = true
View
26 ...gins/searchgasm/lib/searchgasm/conditions/base.rb → ...ns/searchlogic/lib/searchlogic/conditions/base.rb
@@ -1,8 +1,8 @@
-module Searchgasm
+module Searchlogic
module Conditions # :nodoc:
# = Conditions
#
- # Represents a collection of conditions and performs various tasks on that collection. For information on each condition see Searchgasm::Condition.
+ # Represents a collection of conditions and performs various tasks on that collection. For information on each condition see Searchlogic::Condition.
# Each condition has its own file and class and the source for each condition is pretty self explanatory.
class Base
include Shared::Utilities
@@ -39,9 +39,9 @@ def column_details # :nodoc:
#
# === Example
#
- # # config/initializers/searchgasm.rb
+ # # config/initializers/searchlogic.rb
# # Actual function for MySQL databases only
- # class SoundsLike < Searchgasm::Condition::Base
+ # class SoundsLike < Searchlogic::Condition::Base
# # The name of the conditions. By default its the name of the class, if you want alternate or alias conditions just add them on.
# # If you don't want to add aliases you don't even need to define this method
# def self.name_for_column(column)
@@ -57,9 +57,9 @@ def column_details # :nodoc:
# end
# end
#
- # Searchgasm::Seearch::Conditions.register_condition(SoundsLike)
+ # Searchlogic::Seearch::Conditions.register_condition(SoundsLike)
def register_condition(condition_class)
- raise(ArgumentError, "You can only register conditions that extend Searchgasm::Condition::Base") unless condition_class.ancestors.include?(Searchgasm::Condition::Base)
+ raise(ArgumentError, "You can only register conditions that extend Searchlogic::Condition::Base") unless condition_class.ancestors.include?(Searchlogic::Condition::Base)
conditions << condition_class unless conditions.include?(condition_class)
end
@@ -72,8 +72,8 @@ def conditions
#
# === Example
#
- # # config/initializers/searchgasm.rb
- # class Ceil < Searchgasm::Modifiers::Base
+ # # config/initializers/searchlogic.rb
+ # class Ceil < Searchlogic::Modifiers::Base
# # The name of the modifier. By default its the name of the class, if you want alternate or alias modifiers just add them on.
# # If you don't want to add aliases you don't even need to define this method
# def self.modifier_names
@@ -93,7 +93,7 @@ def conditions
# end
# end
#
- # Searchgasm::Seearch::Conditions.register_modifiers(Ceil)
+ # Searchlogic::Seearch::Conditions.register_modifiers(Ceil)
#
# Now here's the fun part, applying this modifier to each connection adapter. Some databases call modifiers differently. If they all apply them the same you can
# add in the function to ActiveRecord::ConnectionAdapters::AbstractAdapter, otherwise you need to add them to each
@@ -110,7 +110,7 @@ def conditions
# ActiveRecord::ConnectionAdapters::MysqlAdapter.send(:include, CeilAdapterMethod)
# # ... include for the rest of the adapters
def register_modifier(modifier_class)
- raise(ArgumentError, "You can only register conditions that extend Searchgasm::Modifiers::Base") unless modifier_class.ancestors.include?(Searchgasm::Modifiers::Base)
+ raise(ArgumentError, "You can only register conditions that extend Searchlogic::Modifiers::Base") unless modifier_class.ancestors.include?(Searchlogic::Modifiers::Base)
modifiers << modifier_class unless modifiers.include?(modifier_class)
end
@@ -230,7 +230,7 @@ def conditions
conditions_hash = {}
objects.each do |name, object|
- if object.class < Searchgasm::Conditions::Base
+ if object.class < Searchlogic::Conditions::Base
relationship_conditions = object.conditions
next if relationship_conditions.blank?
conditions_hash[name] = relationship_conditions
@@ -252,7 +252,7 @@ def add_associations!
self.class.class_eval <<-"end_eval", __FILE__, __LINE__
def #{association.name}
if objects[:#{association.name}].nil?
- objects[:#{association.name}] = Searchgasm::Conditions::Base.create_virtual_class(#{association.class_name}).new
+ objects[:#{association.name}] = Searchlogic::Conditions::Base.create_virtual_class(#{association.class_name}).new
objects[:#{association.name}].relationship_name = "#{association.name}"
objects[:#{association.name}].protect = protect
end
@@ -457,7 +457,7 @@ def assert_valid_conditions(conditions)
def associations
associations = {}
objects.each do |name, object|
- associations[name] = object if object.class < ::Searchgasm::Conditions::Base
+ associations[name] = object if object.class < ::Searchlogic::Conditions::Base
end
associations
end
View
2  ...earchgasm/lib/searchgasm/conditions/protection.rb → ...rchlogic/lib/searchlogic/conditions/protection.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Conditions
# = Conditions Protection
#
View
10 vendor/plugins/searchgasm/lib/searchgasm/config.rb → vendor/plugins/searchlogic/lib/searchlogic/config.rb
@@ -1,16 +1,16 @@
-module Searchgasm
+module Searchlogic
# = Config
- # Adds default configuration for all of searchgasm. For rails the best place to do this is in config/initializers. Create a file in there called searchgasm.rb with the following content:
+ # Adds default configuration for all of searchlogic. For rails the best place to do this is in config/initializers. Create a file in there called searchlogic.rb with the following content:
#
# === Example
#
- # # config/iniitializers/searchgasm.rb
- # Searchgasm::Config.configure do |config|
+ # # config/iniitializers/searchlogic.rb
+ # Searchlogic::Config.configure do |config|
# config.search.per_page = 25
# config.helpers.order_by_link_asc_indicator = "My indicator"
# end
#
- # For a list of all configuration options see Searchgasm::Config::Search and Searchgasm::Config::Helpers
+ # For a list of all configuration options see Searchlogic::Config::Search and Searchlogic::Config::Helpers
class Config
class << self
# Convenience method for setting configuration
View
12 ...ugins/searchgasm/lib/searchgasm/config/helpers.rb → ...ins/searchlogic/lib/searchlogic/config/helpers.rb
@@ -1,24 +1,24 @@
-module Searchgasm
+module Searchlogic
class Config
# = Helpers Configuration
- # Provide configuration for searchgasm's rails helpers
+ # Provide configuration for searchlogic's rails helpers
#
# === Example
- # Searchgasm::Config.configure do |config|
+ # Searchlogic::Config.configure do |config|
# config.helpers.order_by_link_asc_indicator = "ASC"
# end
class Helpers
class << self
- # Which hidden fields to automatically include when creating a form with a Searchgasm object. See Searchgasm::Helpers::Form for more info.
+ # Which hidden fields to automatically include when creating a form with a Searchlogic object. See Searchlogic::Helpers::Form for more info.
#
# * <tt>Default:</tt> [:order_by, :order_as, :per_page]
# * <tt>Accepts:</tt> Array, nil, false
def hidden_fields
- @hidden_fields ||= (Searchgasm::Search::Base::SPECIAL_FIND_OPTIONS - [:page, :priority_order])
+ @hidden_fields ||= (Searchlogic::Search::Base::SPECIAL_FIND_OPTIONS - [:page, :priority_order])
end
attr_writer :hidden_fields
- # Searchgasm does some javascript magic when you use the form helpers with a Searchgasm object. To make configuration easier Searchgasm checks for the existence of Prototype and jQuery and uses the first
+ # Searchlogic does some javascript magic when you use the form helpers with a Searchlogic object. To make configuration easier Searchlogic checks for the existence of Prototype and jQuery and uses the first
# one it finds. To cut back on the javascript output you can specify your library here.
#
# * <tt>Default:</tt> nil
View
12 ...lugins/searchgasm/lib/searchgasm/config/search.rb → ...gins/searchlogic/lib/searchlogic/config/search.rb
@@ -1,10 +1,10 @@
-module Searchgasm
+module Searchlogic
class Config
# = Search Configuration
- # Provides configuration for searchgasm
+ # Provides configuration for searchlogic
#
# === Example
- # Searchgasm::Config.configure do |config|
+ # Searchlogic::Config.configure do |config|
# config.search.per_page = 50
# end
class Search
@@ -26,11 +26,11 @@ def per_page=(value)
@per_page = value
end
- # If you are using ActiveRecord < 2.2.0 then ActiveRecord does not remove duplicates when using the :joins option, when it should. To fix this problem searchgasm does this for you. Searchgasm tries to act
+ # If you are using ActiveRecord < 2.2.0 then ActiveRecord does not remove duplicates when using the :joins option, when it should. To fix this problem searchlogic does this for you. Searchlogic tries to act
# just like ActiveRecord, but in this instance it doesn't make sense.
#
- # As a result, Searchgasm removes all duplicates results in *ALL* search / calculation queries. It does this by forcing the DISTINCT or GROUP BY operation in your SQL. Which might come as a surprise to you
- # since it is not the "norm". If you don't want searchgasm to do this, set this to false.
+ # As a result, Searchlogic removes all duplicates results in *ALL* search / calculation queries. It does this by forcing the DISTINCT or GROUP BY operation in your SQL. Which might come as a surprise to you
+ # since it is not the "norm". If you don't want searchlogic to do this, set this to false.
#
# * <tt>Default:</tt> true
# * <tt>Accepts:</tt> Boolean
View
4 ...lugins/searchgasm/lib/searchgasm/core_ext/hash.rb → ...gins/searchlogic/lib/searchlogic/core_ext/hash.rb
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module CoreExt # :nodoc: all
module Hash
def deep_dup
@@ -72,4 +72,4 @@ def fast_assert_valid_keys(valid_keys)
end
end
-Hash.send(:include, Searchgasm::CoreExt::Hash)
+Hash.send(:include, Searchlogic::CoreExt::Hash)
View
54 ...gasm/lib/searchgasm/helpers/control_types/link.rb → ...gic/lib/searchlogic/helpers/control_types/link.rb
<
@@ -1,4 +1,4 @@
-module Searchgasm
+module Searchlogic
module Helpers
# = Control Type Helpers
#
@@ -6,7 +6,7 @@ module Helpers
#
# === Tutorial
#
- # Check out my tutorial on how to implement searchgasm into a rails app: http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm
+ # Check out my tutorial on how to implement searchlogic into a rails app: http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchlogic
#
# === How it's organized
#
@@ -50,7 +50,7 @@ module Helpers
# => creates a drop down instead of a group of links. The user can select the page in the drop down and it will be as if they clicked a link for that page.
#
# You can apply the _link, _links, or _select to any of the following: order_by, order_as, per_page, page. You have your choice on how you want to set up the interface. For more information and options on these individual
- # helpers check out their source files. Look at the sub modules under this one (Ex: Searchgasm::Helpers::ControlTypes::Select)
+ # helpers check out their source files. Look at the sub modules under this one (Ex: Searchlogic::Helpers::ControlTypes::Select)
module ControlTypes
# = Link Control Types
#
@@ -66,7 +66,7 @@ module Link
# order_by_link([{:orders => :total}, :first_name])
# order_by_link(:id, :text => "Order Number", :html => {:class => "order_number"})
#
- # What's nifty about this is that the value gets "serialized", if it is not a string or a symbol, so that it can be passed via a param in the url. Searchgasm will automatically try to "unserializes" this value and use it. This allows you
+ # What's nifty about this is that the value gets "serialized", if it is not a string or a symbol, so that it can be passed via a param in the url. Searchlogic will automatically try to "unserializes" this value and use it. This allows you
# to pass complex objects besides strings and symbols, such as arrays and hashes. All of the hard work is done for you.
#
# Another thing to keep in mind is that this will alternate between "asc" and "desc" each time it is clicked.
@@ -86,7 +86,7 @@ module Link
# * <tt>:exclude_search_params</tt> -- default: nil, Same as :exclude_params but for the :search_params.
def order_by_link(order_by, options = {})
add_order_by_link_defaults!(order_by, options)
- html = searchgasm_state(options)
+ html = searchlogic_state(options)
if !options[:is_remote]
html += link_to(options[:text], options[:url], options[:html])
@@ -118,7 +118,7 @@ def order_by_link(order_by, options = {})
# * <tt>:exclude_search_params</tt> -- default: nil, Same as :exclude_params but for the :search_params.
def order_as_link(order_as, options = {})
add_order_as_link_defaults!(order_as, options)
- html = searchgasm_state(options)
+ html = searchlogic_state(options)
if !options[:is_remote]
html += link_to(options[:text], options[:url], options[:html])
@@ -159,7 +159,7 @@ def order_as_link(order_as, options = {})
# * <tt>:exclude_search_params</tt> -- default: nil, Same as :exclude_params but for the :search_params.
def priority_order_by_link(priority_order_by, priority_order_as, options = {})
add_priority_order_by_link_defaults!(priority_order_by, priority_order_as, options)
- html = searchgasm_state(options)
+ html = searchlogic_state(options)
if !options[:is_remote]
html += link_to(options[:text], options[:url], options[:html])
@@ -192,7 +192,7 @@ def priority_order_by_link(priority_order_by, priority_order_as, options = {})
# * <tt>:exclude_search_params</tt> -- default: nil, Same as :exclude_params but for the :search_params.
def per_page_link(per_page, options = {})
add_per_page_link_defaults!(per_page, options)