Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Prep v0.3.1 #26

Merged
merged 2 commits into from
Dec 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails23.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails30.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails31.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails32.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails32_mysql.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails32_pg.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails40.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: /Users/mezis/Dropbox/Development/fuzzily
specs:
fuzzily (0.3.0)
fuzzily (0.3.1)
activerecord (>= 2.3.17)

GEM
Expand Down
33 changes: 11 additions & 22 deletions lib/fuzzily/searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,7 @@ def make_field_fuzzily_searchable(field, options={})
end
end

module Rails2ClassMethods
include ClassMethods

def self.extended(base)
base.class_eval do
named_scope :offset, lambda { |*args| { :offset => args.first } }
end
end

module Rails2Rails3ClassMethods
private

def _add_trigram_association(_o)
Expand All @@ -159,23 +151,20 @@ def _with_included_trigrams(_o)
end
end

module Rails3ClassMethods
module Rails2ClassMethods
include ClassMethods
include Rails2Rails3ClassMethods

private

def _add_trigram_association(_o)
has_many _o.trigram_association,
:class_name => _o.trigram_class_name,
:as => :owner,
:conditions => { :fuzzy_field => _o.field.to_s },
:dependent => :destroy,
:autosave => true
def self.extended(base)
base.class_eval do
named_scope :offset, lambda { |*args| { :offset => args.first } }
end
end
end

def _with_included_trigrams(_o)
self.scoped(:include => _o.trigram_association)
end
module Rails3ClassMethods
include ClassMethods
include Rails2Rails3ClassMethods
end


Expand Down
2 changes: 1 addition & 1 deletion lib/fuzzily/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Fuzzily
VERSION = "0.3.0"
VERSION = "0.3.1"
end