Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Deprecate Column#type_cast_code

  • Loading branch information...
commit f50c160cd028bd3e16c46dcba7692439daf709c8 1 parent 77a0fc1
@carlosantoniodasilva carlosantoniodasilva authored
View
4 activerecord/lib/active_record/connection_adapters/column.rb
@@ -1,4 +1,5 @@
require 'set'
+require 'active_support/deprecation'
module ActiveRecord
# :stopdoc:
@@ -107,6 +108,9 @@ def type_cast(value)
end
def type_cast_code(var_name)
+ ActiveSupport::Deprecation.warn("Column#type_cast_code is deprecated in favor of" \
+ "using Column#type_cast only, and it is going to be removed in future Rails versions.")
+
klass = self.class.name
case type
View
4 activerecord/test/cases/attribute_methods/read_test.rb
@@ -6,10 +6,6 @@ module ActiveRecord
module AttributeMethods
class ReadTest < ActiveRecord::TestCase
class FakeColumn < Struct.new(:name)
- def type_cast_code(var)
- var
- end
-
def type; :integer; end
end
Please sign in to comment.
Something went wrong with that request. Please try again.