Open fdutey opened 2 years ago
Hi,
I couldn't find a solution to cast array types with arel extensions. According to the source code, only "raw" types are allowed but not things like int[].
int[]
Is there a workaround? Thanks
Edit: my (very poor) workaround looks like this
table = scope.arel_table version = table[:version] split_version = Arel::Nodes::NamedFunction.new( 'string_to_array', [version, Arel::Nodes::Quoted.new('.')] ) # FIXME poor typecasting cast = Arel.sql("#{split_version.to_sql}::int[]")
it works but im open to any "less ugly" solution because this one is just dirty as hell
Hi,
I couldn't find a solution to cast array types with arel extensions. According to the source code, only "raw" types are allowed but not things like
int[]
.Is there a workaround? Thanks
Edit: my (very poor) workaround looks like this
it works but im open to any "less ugly" solution because this one is just dirty as hell