wvanbergen / active_olap

OLAP extensions for ActiveRecord
http://wiki.github.com/wvanbergen/active_olap
MIT License
55 stars 7 forks source link

Not handling date_trends and time dimension when there is no data. #3

Closed sadowski closed 14 years ago

sadowski commented 14 years ago

When a date trend or time dimension is used and there is no data you get and sql error. Line 65 of dimension.rb: "CASE #{whens.join(' ')} ELSE NULL END AS #{@klass.connection.send(:quote_column_name, variable_name)}";

returns: CASE ELSE NULL END AS "dimension_0"

Which is invalid. Might want to add a check for the "whens" variable on like 64.

wvanbergen commented 14 years ago

I added a check to see if a dimension has at least one category; it will raise an exception otherwise. The fix is released in version 0.0.6.