diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-12-29 11:24:44 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-29 11:27:32 -0700 |
commit | 6160bfbda1d1781c3b08a33ec4955f170e95be11 (patch) | |
tree | 82f04cf6f61d64e3950acaef60b937bf7432c371 /lib/arel/nodes.rb | |
parent | 008445d6fd5f825d9b445ac75a7be67f0f7ab52c (diff) | |
download | rails-6160bfbda1d1781c3b08a33ec4955f170e95be11.tar.gz rails-6160bfbda1d1781c3b08a33ec4955f170e95be11.tar.bz2 rails-6160bfbda1d1781c3b08a33ec4955f170e95be11.zip |
Allow a type caster to be given to the `Arel::Table` object
This will allow most consuming code to avoid the deprecation introduced
in 008445d6fd5f825d9b445ac75a7be67f0f7ab52c. The only code which will be
affected is code that is building the `Arel::Table` object manually,
rather than calling `arel_table` on an Active Record class. Hopefully
this case will be rare enough that we don't need to introduce any
additional APIs to work around it.
Diffstat (limited to 'lib/arel/nodes.rb')
-rw-r--r-- | lib/arel/nodes.rb | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/arel/nodes.rb b/lib/arel/nodes.rb index 8432106719..7d900fe710 100644 --- a/lib/arel/nodes.rb +++ b/lib/arel/nodes.rb @@ -87,17 +87,6 @@ module Arel else case attribute when Arel::Attributes::Attribute - unless $arel_silence_type_casting_deprecation - warn <<-eowarn -Arel performing automatic type casting is deprecated, and will be removed in Arel 8.0. If you are seeing this, it is because you are manually passing a value to an Arel predicate. - -If you're certain the value is already of the right type, change `attribute.eq(value)` to `attribute.eq(Arel::Nodes::Quoted.new(value))` (you will be able to remove that in Arel 8.0, it is only required to silence this deprecation warning). - -You can also silence this warning globally by setting `$arel_silence_type_casting_deprecation` to `true`. (Do NOT do this if you are a library author) - -If you are passing user input to a predicate, you are responsible for type casting appropriately before passing the value to Arel. - eowarn - end Casted.new other, attribute else Quoted.new other |