activerecord-sqlserver-adapter 3.1.5 → 3.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ * 3.1.6 *
3
+
4
+ * Add explicit order-by clause for windowed results. Fixes #161.
5
+
6
+
2
7
  * 3.1.5 *
3
8
 
4
9
  * Better support for orders with an expression. Fixes #155. [Jason Frey, Joe Rafaniello]
@@ -3,7 +3,7 @@ module ActiveRecord
3
3
  module Sqlserver
4
4
  module Version
5
5
 
6
- VERSION = '3.1.5'
6
+ VERSION = '3.1.6'
7
7
 
8
8
  end
9
9
  end
@@ -165,6 +165,7 @@ module Arel
165
165
  end
166
166
 
167
167
  def visit_Arel_Nodes_SelectStatementWithOffset(o)
168
+ o.limit ||= Arel::Nodes::Limit.new(9223372036854775807)
168
169
  orders = rowtable_orders(o)
169
170
  [ "SELECT",
170
171
  (visit(o.limit) if o.limit && !windowed_single_distinct_select_statement?(o)),
@@ -174,6 +175,7 @@ module Arel
174
175
  visit_Arel_Nodes_SelectStatementWithOutOffset(o,true),
175
176
  ") AS [__rnt]",
176
177
  (visit(o.offset) if o.offset),
178
+ "ORDER BY [__rnt].[__rn] ASC"
177
179
  ].compact.join ' '
178
180
  end
179
181
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 5
10
- version: 3.1.5
9
+ - 6
10
+ version: 3.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ken Collins
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2011-12-27 00:00:00 Z
22
+ date: 2012-02-08 00:00:00 Z
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: activerecord
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements: []
90
90
 
91
91
  rubyforge_project: activerecord-sqlserver-adapter
92
- rubygems_version: 1.8.12
92
+ rubygems_version: 1.8.15
93
93
  signing_key:
94
94
  specification_version: 3
95
95
  summary: SQL Server 2005 and 2008 Adapter For ActiveRecord.