bowtie 0.4.7 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
data/bowtie.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{bowtie}
3
- s.version = "0.4.7"
3
+ s.version = "0.4.8"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Tomás Pollak"]
@@ -5,11 +5,11 @@ module Bowtie
5
5
  end
6
6
 
7
7
  def self.search(model, q, page)
8
- query = {}
8
+ query = []
9
9
  model.searchable_fields.each do |field|
10
- query[field.like] = "%#{q}%"
10
+ query << "#{model}.all(:#{field}.like => '%#{q}%')"
11
11
  end
12
- model.all(query).page(page, :per_page => PER_PAGE)
12
+ eval(query.join(' + ')).page(page, :per_page => PER_PAGE)
13
13
  end
14
14
 
15
15
  def self.get_many(model, params, page)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bowtie
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 7
10
- version: 0.4.7
9
+ - 8
10
+ version: 0.4.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Tom\xC3\xA1s Pollak"