quadule / activerecord-postgresql-cube

ActiveRecord support for the PostgreSQL cube data type.
MIT License
8 stars 5 forks source link

Support cubes with volume #2

Open pjungwir opened 7 years ago

pjungwir commented 7 years ago

It looks like right now this gem only supports zero-volume values. Are you interested in a PR that accepts non-point values? With postgres you can give a min/max for each dimension with cube(ARRAY[the, min, values], ARRAY[the, max, values]). What do you think would be a good way to represent that in Ruby?

I'm not sure myself if that would be useful for model attributes, but it seems useful as a condition in a query, e.g. WHERE features && cube(ARRAY[1,1,1], ARRAY[3,7,10]).

quadule commented 7 years ago

Sorry, I forgot to watch my own repo and missed this earlier. I haven't had time to work on this in a while but I'm definitely open to a PR for this functionality!