You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As there is no visitor for the Float type it should expect that the consumer will provide proper Arel.sql node as an argument instead of a number.
Either remove the to_f or rewrap it into Arel.sql (could hide errors when invalid value was provided).
The text was updated successfully, but these errors were encountered:
Buk1m
changed the title
st_bugger using to_f does causes error when building the query with arel: Unsupported argument type: Float. Construct an Arel node instead
st_buffer using to_f does causes error when building the query with arel: Unsupported argument type: Float. Construct an Arel node instead
Dec 12, 2024
Buk1m
changed the title
st_buffer using to_f does causes error when building the query with arel: Unsupported argument type: Float. Construct an Arel node instead
st_buffer using to_f causes error when building the query with arel: Unsupported argument type: Float. Construct an Arel node instead
Dec 12, 2024
Buk1m
changed the title
st_buffer using to_f causes error when building the query with arel: Unsupported argument type: Float. Construct an Arel node instead
st_buffer usage of to_f causes error when building the query with Arel: Unsupported argument type: Float. Construct an Arel node instead
Dec 12, 2024
Similar issue with the units.to_s on the next line
either it should expected an Arel::Nodes::SqlLiteral without calling the to_s
or the spatial_flags should be [true, true, true] as this is the only path that supports visiting String.
Am I using an incorrect version of the library? I would assume such issues would be quickly reported/discovered.
Issue description
Error caused by the
distance.to_f
within theRGeo::ActiveRecord::SpatialExpressions.st_buffer
functionspatial_expressions.rb#L125
Reproduction
With ActiveRecord 7+ prepare a query using Arel with
st_buffer(100)
and callto_sql
on it.Error
Context
https://github.com/rails/rails/blob/v7.0.8.5/activerecord/lib/arel/visitors/to_sql.rb#L770
Solution?
As there is no visitor for the Float type it should expect that the consumer will provide proper Arel.sql node as an argument instead of a number.
Either remove the
to_f
or rewrap it intoArel.sql
(could hide errors when invalid value was provided).Environment:
The text was updated successfully, but these errors were encountered: