Currently, the value of a constraint added to a criteria is converted to a representation which is persistable in parse, but this practice does not take into account the field type the value is being checked against. This can lead to some wonky logic bombs:
class Model
include Opium::Model
field :index, type: Integer
end
Model.where( index: "5" )
In the example, "5" would get translated to a string, not to a numeric; as such, the query, when presented to parse, would likely not return valid results.
Altering the behavior should be simple enough, as Queryable#translate_to_parse should have access to the field information. However, need to verify that this does not unintentionally bork something elsewhere.
Currently, the value of a constraint added to a criteria is converted to a representation which is persistable in parse, but this practice does not take into account the field type the value is being checked against. This can lead to some wonky logic bombs:
In the example,
"5"
would get translated to a string, not to a numeric; as such, the query, when presented to parse, would likely not return valid results.Altering the behavior should be simple enough, as
Queryable#translate_to_parse
should have access to the field information. However, need to verify that this does not unintentionally bork something elsewhere.