searchgasm 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,9 @@
1
- == 1.3.0 released 2008-09-29
1
+ == 1.3.1 released 2008-10-02
2
+
3
+ * Fixed bug when requiring a connection adapter that is not present
4
+ * Fixes bug in "not" conditions
5
+
6
+ == 1.3.0 released 2008-10-02
2
7
 
3
8
  * Added modifiers into the mix: hour_of_created_at_less_than = 10, etc.
4
9
  * 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
@@ -10,7 +10,10 @@ module Searchgasm
10
10
  def to_conditions(value)
11
11
  begin_with = BeginWith.new
12
12
  begin_with.value = value
13
- being_with.to_conditions.gsub(" LIKE ", " NOT LIKE ")
13
+ conditions = being_with.to_conditions
14
+ return conditions if conditions.blank?
15
+ conditions.first.gsub!(" LIKE ", " NOT LIKE ")
16
+ conditions
14
17
  end
15
18
  end
16
19
  end
@@ -10,7 +10,10 @@ module Searchgasm
10
10
  def to_conditions(value)
11
11
  ends_with = EndsWith.new
12
12
  ends_with.value = value
13
- ends_with.to_conditions.gsub(" LIKE ", " NOT LIKE ")
13
+ conditions = ends_with.to_conditions
14
+ return conditions if conditions.blank?
15
+ conditions.first.gsub!(" LIKE ", " NOT LIKE ")
16
+ conditions
14
17
  end
15
18
  end
16
19
  end
@@ -10,7 +10,10 @@ module Searchgasm
10
10
  def to_conditions(value)
11
11
  keywords = Keywords.new
12
12
  keywords.value = value
13
- keywords.to_conditions.gsub(" LIKE ", " NOT LIKE ")
13
+ conditions = keywords.to_conditions
14
+ return conditions if conditions.blank?
15
+ conditions.first.gsub!(" LIKE ", " NOT LIKE ")
16
+ conditions
14
17
  end
15
18
  end
16
19
  end
@@ -10,7 +10,10 @@ module Searchgasm
10
10
  def to_conditions(value)
11
11
  like = Like.new
12
12
  like.value = value
13
- like.to_conditions.gsub(" LIKE ", " NOT LIKE ")
13
+ conditions = like.to_conditions
14
+ return conditions if conditions.blank?
15
+ conditions.first.gsub!(" LIKE ", " NOT LIKE ")
16
+ conditions
14
17
  end
15
18
  end
16
19
  end
@@ -67,7 +67,7 @@ module Searchgasm
67
67
 
68
68
  MAJOR = 1
69
69
  MINOR = 3
70
- TINY = 0
70
+ TINY = 1
71
71
 
72
72
  # The current version as a Version instance
73
73
  CURRENT = new(MAJOR, MINOR, TINY)
data/lib/searchgasm.rb CHANGED
@@ -1,11 +1,16 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
2
-
2
+
3
+ require "active_support"
3
4
  require "active_record"
4
5
  require "active_record/version"
5
- require "active_record/connection_adapters/mysql_adapter"
6
- require "active_record/connection_adapters/postgresql_adapter"
7
- require "active_record/connection_adapters/sqlite_adapter"
8
- require "active_support"
6
+
7
+ ["mysql", "postgresql", "sqlite"].each do |adapter_name|
8
+ begin
9
+ require "active_record/connection_adapters/#{adapter_name}_adapter"
10
+ require "searchgasm/active_record/connection_adapters/#{adapter_name}_adapter"
11
+ rescue Exception
12
+ end
13
+ end
9
14
 
10
15
  # Core Ext
11
16
  require "searchgasm/core_ext/hash"
@@ -21,9 +26,6 @@ require "searchgasm/config"
21
26
  # ActiveRecord
22
27
  require "searchgasm/active_record/base"
23
28
  require "searchgasm/active_record/associations"
24
- require "searchgasm/active_record/connection_adapters/mysql_adapter"
25
- require "searchgasm/active_record/connection_adapters/postgresql_adapter"
26
- require "searchgasm/active_record/connection_adapters/sqlite_adapter"
27
29
 
28
30
  # Search
29
31
  require "searchgasm/search/ordering"
data/searchgasm.gemspec CHANGED
@@ -1,11 +1,11 @@
1
1
 
2
- # Gem::Specification for Searchgasm-1.3.0
2
+ # Gem::Specification for Searchgasm-1.3.1
3
3
  # Originally generated by Echoe
4
4
 
5
5
  --- !ruby/object:Gem::Specification
6
6
  name: searchgasm
7
7
  version: !ruby/object:Gem::Version
8
- version: 1.3.0
8
+ version: 1.3.1
9
9
  platform: ruby
10
10
  authors:
11
11
  - Ben Johnson of Binary Logic
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchgasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic