active_olap 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/active_olap.gemspec +2 -2
- data/lib/active_olap/dimension.rb +4 -1
- metadata +2 -2
data/active_olap.gemspec
CHANGED
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'active_olap'
|
3
3
|
|
4
4
|
# Do not update version and date by hand: this will be done automatically.
|
5
|
-
s.version = "0.0.
|
6
|
-
s.date = "
|
5
|
+
s.version = "0.0.5"
|
6
|
+
s.date = "2010-01-19"
|
7
7
|
|
8
8
|
s.summary = "Extend ActiveRecord with OLAP query functionality."
|
9
9
|
s.description = "Extends ActiveRecord with functionality to perform OLAP queries on your data. Includes helper method to ease displaying the results."
|
@@ -57,7 +57,10 @@ module ActiveOLAP
|
|
57
57
|
# Builds a CASE expression for this dimension.
|
58
58
|
def to_case_expression(variable_name)
|
59
59
|
if @category_field
|
60
|
-
|
60
|
+
quoted_field_name = @klass.connection.send(:quote_table_name, @klass.table_name) + '.' +
|
61
|
+
@klass.connection.send(:quote_column_name, @category_field)
|
62
|
+
|
63
|
+
"#{quoted_field_name} AS #{@klass.connection.send(:quote_column_name, variable_name)}"
|
61
64
|
else
|
62
65
|
whens = @categories.map { |category| @klass.send(:sanitize_sql, ["WHEN (#{category.to_sanitized_sql}) THEN ?", category.label.to_s]) }
|
63
66
|
"CASE #{whens.join(' ')} ELSE NULL END AS #{@klass.connection.send(:quote_column_name, variable_name)}";
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_olap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-19 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|