aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-07-01 19:30:43 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-07-01 19:30:43 -0700
commit150266706372850eb90706e8ec892e6138448de9 (patch)
tree49ccb679b04d6ca6ab69b617d6deace2b6d3a5b2 /activerecord/lib
parentf62fb985b6a7b90872148f0786219c9cc94c9356 (diff)
parentcfc54e417de41ef087e4e2bc777d5d9e11ca5132 (diff)
downloadrails-150266706372850eb90706e8ec892e6138448de9.tar.gz
rails-150266706372850eb90706e8ec892e6138448de9.tar.bz2
rails-150266706372850eb90706e8ec892e6138448de9.zip
Merge pull request #11231 from neerajdotname/deprecated-type-cast-code
Removed deprecated method type_cast_code from Column
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/column.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb
index 609ccc2ed2..cc02b313e1 100644
--- a/activerecord/lib/active_record/connection_adapters/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/column.rb
@@ -107,30 +107,6 @@ module ActiveRecord
end
end
- def type_cast_code(var_name)
- message = "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."
- ActiveSupport::Deprecation.warn message
-
- klass = self.class.name
-
- case type
- when :string, :text then var_name
- when :integer then "#{klass}.value_to_integer(#{var_name})"
- when :float then "#{var_name}.to_f"
- when :decimal then "#{klass}.value_to_decimal(#{var_name})"
- when :datetime, :timestamp then "#{klass}.string_to_time(#{var_name})"
- when :time then "#{klass}.string_to_dummy_time(#{var_name})"
- when :date then "#{klass}.value_to_date(#{var_name})"
- when :binary then "#{klass}.binary_to_string(#{var_name})"
- when :boolean then "#{klass}.value_to_boolean(#{var_name})"
- when :hstore then "#{klass}.string_to_hstore(#{var_name})"
- when :inet, :cidr then "#{klass}.string_to_cidr(#{var_name})"
- when :json then "#{klass}.string_to_json(#{var_name})"
- else var_name
- end
- end
-
# Returns the human name of the column name.
#
# ===== Examples