diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-02-07 17:23:30 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-02-07 17:23:30 -0700 |
commit | 16629c099ca30895c90661d5cbce40e218f0984e (patch) | |
tree | dcb8195749f9f6181e0b04fe2848474b6e14b47c /activerecord/lib/active_record/type/string.rb | |
parent | c4ef73affdc67efb02ca369326aaaaab3fd94d21 (diff) | |
download | rails-16629c099ca30895c90661d5cbce40e218f0984e.tar.gz rails-16629c099ca30895c90661d5cbce40e218f0984e.tar.bz2 rails-16629c099ca30895c90661d5cbce40e218f0984e.zip |
rm `Type#text?`
This predicate was only to figure out if it's safe to do case
insensitive comparison, which is only a problem on PG. Turns out, PG can
just tell us whether we are able to do it or not. If the query turns out
to be a problem, let's just replace that method with checking the SQL
type for `text` or `character`. I'd rather not burden the type objects
with adapter specific knowledge.
The *real* solution, is to deprecate this behavior entirely. The only
reason we need it is because the `:case_sensitive` option for
`validates_uniqueness_of` is documented as "this option is ignored for
non-strings". It makes no sense for us to do that. If the type can't be
compared in a case insensitive way, the user shouldn't tell us to do
case insensitive comparison.
Diffstat (limited to 'activerecord/lib/active_record/type/string.rb')
-rw-r--r-- | activerecord/lib/active_record/type/string.rb | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/type/string.rb b/activerecord/lib/active_record/type/string.rb index cf95e25be0..fbc0af2c5a 100644 --- a/activerecord/lib/active_record/type/string.rb +++ b/activerecord/lib/active_record/type/string.rb @@ -21,10 +21,6 @@ module ActiveRecord end end - def text? - true - end - private def cast_value(value) |