lib/mongoid_search.rb in mongoid_search-0.3.2 vs lib/mongoid_search.rb in mongoid_search-0.3.3
- old
+ new
@@ -1,10 +1,13 @@
# encoding: utf-8
-require 'mongoid_search/railtie' if defined?(Rails)
require 'mongoid_search/mongoid_search'
+if defined?(Rails)
+ require 'mongoid_search/railtie'
+end
+
module Mongoid::Search
## Default matching type. Match :any or :all searched keywords
mattr_accessor :match
@@match = :any
@@ -43,11 +46,11 @@
## Match partial words on both sides (slower)
@@regex = Proc.new { |query| /#{query}/ }
## Match partial words on the beginning or in the end (slightly faster)
- # @@regex = Proc.new { |query| /ˆ#{query}/ }
+ # @@regex = Proc.new { |query| /^#{query}/ }
# @@regex = Proc.new { |query| /#{query}$/ }
# Ligatures to be replaced
# http://en.wikipedia.org/wiki/Typographic_ligature
mattr_accessor :ligatures
@@ -61,6 +64,6 @@
yield self
end
end
require 'mongoid_search/util'
-require 'mongoid_search/log'
\ No newline at end of file
+require 'mongoid_search/log'