diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2013-04-02 18:54:10 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2013-04-02 18:54:10 -0700 |
commit | a7ef0982d44c7bdac5e41a1a97afb8eaa537d6db (patch) | |
tree | 98fc77e641a05408788732d02e8da63bde10c5a7 /activerecord/lib/active_record/connection_adapters/column.rb | |
parent | aec0e68e641b3abab0830bc24e69694a7ba33c41 (diff) | |
parent | 0a57f3460119e8fe77250835c0d0fab808ea2ca6 (diff) | |
download | rails-a7ef0982d44c7bdac5e41a1a97afb8eaa537d6db.tar.gz rails-a7ef0982d44c7bdac5e41a1a97afb8eaa537d6db.tar.bz2 rails-a7ef0982d44c7bdac5e41a1a97afb8eaa537d6db.zip |
Merge pull request #10063 from SamSaffron/master
Per #9999 revert blank? to empty?
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index a4b3a0c584..609ccc2ed2 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -161,7 +161,7 @@ module ActiveRecord def value_to_date(value) if value.is_a?(String) - return nil if value.blank? + return nil if value.empty? fast_string_to_date(value) || fallback_string_to_date(value) elsif value.respond_to?(:to_date) value.to_date @@ -172,14 +172,14 @@ module ActiveRecord def string_to_time(string) return string unless string.is_a?(String) - return nil if string.blank? + return nil if string.empty? fast_string_to_time(string) || fallback_string_to_time(string) end def string_to_dummy_time(string) return string unless string.is_a?(String) - return nil if string.blank? + return nil if string.empty? dummy_time_string = "2000-01-01 #{string}" @@ -192,7 +192,7 @@ module ActiveRecord # convert something to a boolean def value_to_boolean(value) - if value.is_a?(String) && value.blank? + if value.is_a?(String) && value.empty? nil else TRUE_VALUES.include?(value) |