username_suggester 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
1
  spec/debug.log
2
2
  spec/db/*.db
3
-
3
+ username_suggester-*.gem
@@ -26,11 +26,11 @@ module UsernameSuggester
26
26
  num_suggestions = options[:num_suggestions] || 10
27
27
 
28
28
  send :define_method, "#{attribute}_suggestions".to_sym do
29
- suggester = Suggester.new(read_attribute(first_name_attribute), read_attribute(last_name_attribute), options)
29
+ suggester = Suggester.new(send(first_name_attribute), send(last_name_attribute), options)
30
30
  name_combinations_with_regex = suggester.name_combinations.map { |s| "^#{s}[0-9]*$" }
31
31
  sql_conditions = Array.new(name_combinations_with_regex.size, "#{attribute} RLIKE ?").join(" OR ")
32
32
  unavailable_choices = self.class.all(:select => attribute,
33
- :conditions => [sql_conditions].concat(name_combinations_with_regex)).map{ |c| c.read_attribute(attribute) }
33
+ :conditions => [sql_conditions].concat(name_combinations_with_regex)).map{ |c| c.send(attribute) }
34
34
  suggester.suggest(num_suggestions, unavailable_choices)
35
35
  end
36
36
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{username_suggester}
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["jerryluk"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: username_suggester
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - jerryluk