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

Commit

Permalink
Merge 097cc2f into efefacb
Browse files Browse the repository at this point in the history
  • Loading branch information
mezis committed Dec 9, 2013
2 parents efefacb + 097cc2f commit 9945dd3
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 33 deletions.
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
4 changes: 2 additions & 2 deletions gemfiles/rails32_pg.gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source "http://yarp.dev"

gem "activerecord", "~> 3.2.0"

gemspec :path=>"../"

ENV['FUZZILY_ADAPTER'] = 'postgresql'
ENV['FUZZILY_DB_USER'] = ENV['TRAVIS'] ? 'postgres' : ENV['USER']
ENV['FUZZILY_DB_USER'] = ENV['TRAVIS'] ? 'postgres' : ENV['USER']
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

0 comments on commit 9945dd3

Please sign in to comment.