searcher 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- searcher (0.0.2)
4
+ searcher (0.0.3)
5
5
  activerecord (~> 3.0.0)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module Searcher
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/searcher.rb CHANGED
@@ -12,10 +12,10 @@ ActiveRecord::Base.extend(Searcher::ClassMethods)
12
12
 
13
13
  ActiveSupport.on_load(:after_initialize) do
14
14
  Searcher.classes.each do |klass|
15
- table = Table(klass.table_name)
15
+ table = klass.arel_table
16
16
  klass.searcher[:labels].each do |name, config|
17
17
  association = klass.reflect_on_association(config[:from])
18
- association_table = Table(association.klass.table_name)
18
+ association_table = association.klass.arel_table
19
19
  if [:has_and_belongs_to_many, :belongs_to].include?(association.macro)
20
20
  scope = lambda { |q, field| klass.joins(config[:from]).where(association_table[field].eq(q)) }
21
21
  klass.scope "by_#{name}", scope
data/searcher.sqlite3 CHANGED
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searcher
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors: []
13
13
 
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-05 00:00:00 +11:00
18
+ date: 2010-11-18 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency