instance method
warn_quote_duration_deprecated
Ruby on Rails 7.1.6
Since v7.1.6 Last seen in v7.1.6 PrivateSignature
warn_quote_duration_deprecated()
No documentation comment.
Source
# File activerecord/lib/active_record/connection_adapters/abstract/quoting.rb, line 248
def warn_quote_duration_deprecated
ActiveRecord.deprecator.warn(<<~MSG)
Using ActiveSupport::Duration as an interpolated bind parameter in a SQL
string template is deprecated. To avoid this warning, you should explicitly
convert the duration to a more specific database type. For example, if you
want to use a duration as an integer number of seconds:
```
Record.where("duration = ?", 1.hour.to_i)
```
If you want to use a duration as an ISO 8601 string:
```
Record.where("duration = ?", 1.hour.iso8601)
```
MSG
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/quoting.rb line 248
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Quoting