ohio_state_person 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,15 +26,15 @@ module OhioStatePerson
26
26
  q = q.to_s
27
27
  h = ActiveSupport::OrderedHash.new
28
28
  if options[:fuzzy]
29
- h[/\A\s*\d+\s*\z/] = lambda { where('emplid LIKE ?', "#{q.strip}%") }
30
- h[/\A\s*\D+\.\d*\s*\z/] = lambda { where('name_n LIKE ?', "#{q.strip}%") } if column_names.include? 'name_n'
29
+ h[/\A\s*\d+\s*\z/] = lambda { where("#{table_name}.emplid LIKE ?", "#{q.strip}%") }
30
+ h[/\A\s*\D+\.\d*\s*\z/] = lambda { where("#{table_name}.name_n LIKE ?", "#{q.strip}%") } if column_names.include? 'name_n'
31
31
  else
32
32
  h[/\A\s*\d+\s*\z/] = lambda { where(:emplid => q.strip) }
33
33
  h[/\A\s*\D+\.\d*\s*\z/] = lambda { where(:name_n => q.strip) } if column_names.include? 'name_n'
34
34
  end
35
- h[/(\S+),\s*(\S*)/] = lambda { where('last_name LIKE ? AND first_name LIKE ?', $1, "#{$2}%") }
36
- h[/(\S+)\s+(\S*)/] = lambda { where('first_name LIKE ? AND last_name LIKE ?', $1, "#{$2}%") }
37
- h[/\S/] = lambda { where('last_name LIKE ?', "#{q}%") }
35
+ h[/(\S+),\s*(\S*)/] = lambda { where("#{table_name}.last_name LIKE ? AND #{table_name}.first_name LIKE ?", $1, "#{$2}%") }
36
+ h[/(\S+)\s+(\S*)/] = lambda { where("#{table_name}.first_name LIKE ? AND #{table_name}.last_name LIKE ?", $1, "#{$2}%") }
37
+ h[/\S/] = lambda { where("#{table_name}.last_name LIKE ?", "#{q}%") }
38
38
  h[//] = lambda { where('1=2') }
39
39
 
40
40
  h.each do |regex, where_clause|
@@ -1,3 +1,3 @@
1
1
  module OhioStatePerson
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohio_state_person
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-27 00:00:00.000000000 Z
12
+ date: 2013-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -161,15 +161,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
161
  - - ! '>='
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
+ segments:
165
+ - 0
166
+ hash: 4469442282912756943
164
167
  required_rubygems_version: !ruby/object:Gem::Requirement
165
168
  none: false
166
169
  requirements:
167
170
  - - ! '>='
168
171
  - !ruby/object:Gem::Version
169
172
  version: '0'
173
+ segments:
174
+ - 0
175
+ hash: 4469442282912756943
170
176
  requirements: []
171
177
  rubyforge_project: ohio_state_person
172
- rubygems_version: 1.8.24
178
+ rubygems_version: 1.8.25
173
179
  signing_key:
174
180
  specification_version: 3
175
181
  summary: ActiveRecord mixin for people at Ohio State University