squeel 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ module Squeel
5
5
  module Aliasing
6
6
 
7
7
  def as(name)
8
- As.new(self, name.to_s)
8
+ As.new(self, Arel.sql(name))
9
9
  end
10
10
 
11
11
  end
@@ -151,7 +151,7 @@ module Squeel
151
151
  path + [endpoint]
152
152
  end
153
153
 
154
- # Impleneted (and aliased to :to_str) to play nicely with ActiveRecord grouped calculations
154
+ # Implement (and alias to :to_str) to play nicely with ActiveRecord grouped calculations
155
155
  def to_s
156
156
  path.map(&:to_s).join('.') << ".#{endpoint}"
157
157
  end
@@ -55,6 +55,7 @@ module Squeel
55
55
  def to_s
56
56
  symbol.to_s
57
57
  end
58
+ alias :to_str :to_s
58
59
 
59
60
  # Create a KeyPath when any undefined method is called on a Stub.
60
61
  # @overload node_name
@@ -1,3 +1,3 @@
1
1
  module Squeel
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
@@ -597,6 +597,7 @@ module Squeel
597
597
  node = relation.as('ernie')
598
598
  node.should be_a Squeel::Nodes::As
599
599
  node.expr.should eq relation
600
+ node.alias.should be_a Arel::Nodes::SqlLiteral
600
601
  node.alias.should eq 'ernie'
601
602
  end
602
603
 
@@ -190,6 +190,7 @@ module Squeel
190
190
  as = @s.as('other_name')
191
191
  as.should be_a Squeel::Nodes::As
192
192
  as.left.should eq @s
193
+ as.right.should be_a Arel::Nodes::SqlLiteral
193
194
  as.right.should eq 'other_name'
194
195
  end
195
196
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squeel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-16 00:00:00.000000000Z
12
+ date: 2011-06-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
- requirement: &2156038840 !ruby/object:Gem::Requirement
16
+ requirement: &2156248280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156038840
24
+ version_requirements: *2156248280
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &2156037840 !ruby/object:Gem::Requirement
27
+ requirement: &2156247580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2156037840
35
+ version_requirements: *2156247580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &2156036880 !ruby/object:Gem::Requirement
38
+ requirement: &2156246920 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.5.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2156036880
46
+ version_requirements: *2156246920
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: machinist
49
- requirement: &2156035680 !ruby/object:Gem::Requirement
49
+ requirement: &2156246220 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.6
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2156035680
57
+ version_requirements: *2156246220
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: faker
60
- requirement: &2156034820 !ruby/object:Gem::Requirement
60
+ requirement: &2156245480 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.9.5
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2156034820
68
+ version_requirements: *2156245480
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
- requirement: &2156033760 !ruby/object:Gem::Requirement
71
+ requirement: &2156244820 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: 1.3.3
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2156033760
79
+ version_requirements: *2156244820
80
80
  description: ! "\n Squeel unlocks the power of ARel in your Rails 3 application
81
81
  with\n a handy block-based syntax. You can write subqueries, access named\n
82
82
  \ functions provided by your RDBMS, and more, all without writing\n SQL