pivotable 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,9 +15,9 @@ class Pivotable::Expression::Calculation < Pivotable::Expression::Abstract
15
15
  def to_select
16
16
  case via
17
17
  when String
18
- "#{via} AS #{model.connection.quote(name)}"
18
+ "#{via} AS #{name}"
19
19
  else
20
- via.clone.as(model.connection.quote(name))
20
+ via.clone.as(name)
21
21
  end
22
22
  end
23
23
 
@@ -3,9 +3,10 @@ class Pivotable::Expression::Generic < Pivotable::Expression::Abstract
3
3
  def to_select
4
4
  case via
5
5
  when String
6
- "#{via} AS #{model.connection.quote(name)}"
6
+ "#{via} AS #{name}"
7
7
  else
8
- via.as(name.to_sym)
8
+ sql = Arel::Visitors.visitor_for(model.arel_table.engine).accept via
9
+ "#{sql} AS #{name}"
9
10
  end
10
11
  end
11
12
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dimitrij Denissenko