pivotable 0.0.4 → 0.1.0

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.
@@ -5,8 +5,6 @@ class Pivotable::Expression::Abstract
5
5
  @name = name.to_s
6
6
  @model = model
7
7
  @via = process_via options[:via]
8
-
9
- raise ArgumentError, "Could not find DB attribute for '#{@name}', please specify a :via option" if via.blank?
10
8
  end
11
9
 
12
10
  def to_select
@@ -5,8 +5,9 @@ class Pivotable::Expression::Generic < Pivotable::Expression::Abstract
5
5
  when String
6
6
  "#{via} AS #{name}"
7
7
  else
8
- sql = Arel::Visitors.visitor_for(model.arel_table.engine).accept via
9
- "#{sql} AS #{name}"
8
+ via.as(name).to_sql.tap do |s|
9
+ s.sub!(/AS .+$/, "AS #{name}") if Arel::VERSION < "2.1.0"
10
+ end
10
11
  end
11
12
  end
12
13
 
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: 23
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 4
10
- version: 0.0.4
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dimitrij Denissenko
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-21 00:00:00 +01:00
19
- default_executable:
18
+ date: 2011-09-01 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: abstract
@@ -38,7 +37,7 @@ dependencies:
38
37
  requirement: &id002 !ruby/object:Gem::Requirement
39
38
  none: false
40
39
  requirements:
41
- - - ~>
40
+ - - ">="
42
41
  - !ruby/object:Gem::Version
43
42
  hash: 7
44
43
  segments:
@@ -46,24 +45,16 @@ dependencies:
46
45
  - 0
47
46
  - 0
48
47
  version: 3.0.0
49
- type: :runtime
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: activesupport
53
- prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ~>
48
+ - - <
58
49
  - !ruby/object:Gem::Version
59
- hash: 7
50
+ hash: 15
60
51
  segments:
61
52
  - 3
53
+ - 2
62
54
  - 0
63
- - 0
64
- version: 3.0.0
55
+ version: 3.2.0
65
56
  type: :runtime
66
- version_requirements: *id003
57
+ version_requirements: *id002
67
58
  description: Great for building APIs & reports
68
59
  email: dimitrij@blacksquaremedia.com
69
60
  executables: []
@@ -74,15 +65,14 @@ extra_rdoc_files: []
74
65
 
75
66
  files:
76
67
  - README.markdown
77
- - lib/pivotable/pivoting.rb
68
+ - lib/pivotable.rb
69
+ - lib/pivotable/expression/abstract.rb
78
70
  - lib/pivotable/expression/generic.rb
79
71
  - lib/pivotable/expression/calculation.rb
80
- - lib/pivotable/expression/abstract.rb
72
+ - lib/pivotable/pivoting.rb
73
+ - lib/pivotable/model.rb
81
74
  - lib/pivotable/expression.rb
82
75
  - lib/pivotable/rotation.rb
83
- - lib/pivotable/model.rb
84
- - lib/pivotable.rb
85
- has_rdoc: true
86
76
  homepage: https://github.com/bsm/pivotable
87
77
  licenses: []
88
78
 
@@ -116,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
106
  requirements: []
117
107
 
118
108
  rubyforge_project:
119
- rubygems_version: 1.6.2
109
+ rubygems_version: 1.8.5
120
110
  signing_key:
121
111
  specification_version: 3
122
112
  summary: Build pivotable data tables with ActiveRecord