diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-05 12:54:29 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-05 12:54:29 -0800 |
commit | 39625d153781ffa07121c35dc4bba40410624c9c (patch) | |
tree | f664795a3e102fa18b58673d679e8740f9f6a6db /activerecord/lib/active_record/validations | |
parent | 013d959917a3f682f921dc6af726fa2136285bed (diff) | |
parent | 803e9bab84df9a93ca5f4613f710b6e088fbe64b (diff) | |
download | rails-39625d153781ffa07121c35dc4bba40410624c9c.tar.gz rails-39625d153781ffa07121c35dc4bba40410624c9c.tar.bz2 rails-39625d153781ffa07121c35dc4bba40410624c9c.zip |
Merge pull request #4330 from lest/remove-call-mbchars
remove useless call to mb_chars
Diffstat (limited to 'activerecord/lib/active_record/validations')
-rw-r--r-- | activerecord/lib/active_record/validations/uniqueness.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index 2e2ea8c42b..d56248b928 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -54,7 +54,7 @@ module ActiveRecord def build_relation(klass, table, attribute, value) #:nodoc: column = klass.columns_hash[attribute.to_s] - value = column.limit ? value.to_s.mb_chars[0, column.limit] : value.to_s if column.text? + value = column.limit ? value.to_s[0, column.limit] : value.to_s if column.text? if !options[:case_sensitive] && value && column.text? # will use SQL LOWER function before comparison, unless it detects a case insensitive collation |