activerecord-sqlserver-adapter 3.1.0.rc6 → 3.1.0.rc8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
2
  * 3.1.0 *
3
3
 
4
+ * Add support/test around handling of float/real column types [Lucas Maxwell]
5
+
4
6
  * Make auto reconnect duration configurable. Fixes #109 [David Chelimsky]
5
7
 
6
8
  * Quote most time objects to use ISO8601 format to be multi-language dateformat compatible. The [datetime] data type is
@@ -214,6 +214,8 @@ module ActiveRecord
214
214
  ci[:type]
215
215
  when /^numeric|decimal$/i
216
216
  "#{ci[:type]}(#{ci[:numeric_precision]},#{ci[:numeric_scale]})"
217
+ when /^float|real$/i
218
+ "#{ci[:type]}(#{ci[:numeric_precision]})"
217
219
  when /^char|nchar|varchar|nvarchar|varbinary|bigint|int|smallint$/
218
220
  ci[:length].to_i == -1 ? "#{ci[:type]}(max)" : "#{ci[:type]}(#{ci[:length]})"
219
221
  else
@@ -79,8 +79,16 @@ module ActiveRecord
79
79
  !!(@sql_type =~ /int/i)
80
80
  end
81
81
 
82
+ def is_real?
83
+ !!(@sql_type =~ /real/i)
84
+ end
85
+
82
86
  def sql_type_for_statement
83
- is_integer? ? sql_type.sub(/\(\d+\)/,'') : sql_type
87
+ if is_integer? || is_real?
88
+ sql_type.sub(/\(\d+\)/,'')
89
+ else
90
+ sql_type
91
+ end
84
92
  end
85
93
 
86
94
  def default_function
@@ -159,7 +167,7 @@ module ActiveRecord
159
167
  include Sqlserver::Errors
160
168
 
161
169
  ADAPTER_NAME = 'SQLServer'.freeze
162
- VERSION = '3.1.0.rc6'.freeze
170
+ VERSION = '3.1.0.rc8'.freeze
163
171
  DATABASE_VERSION_REGEXP = /Microsoft SQL Server\s+"?(\d{4}|\w+)"?/
164
172
  SUPPORTED_VERSIONS = [2005,2008,2010,2011].freeze
165
173
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424105
4
+ hash: 15424117
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
9
  - 0
10
10
  - rc
11
- - 6
12
- version: 3.1.0.rc6
11
+ - 8
12
+ version: 3.1.0.rc8
13
13
  platform: ruby
14
14
  authors:
15
15
  - Ken Collins
@@ -21,7 +21,7 @@ autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
23
 
24
- date: 2011-08-17 00:00:00 -04:00
24
+ date: 2011-08-30 00:00:00 -04:00
25
25
  default_executable:
26
26
  dependencies:
27
27
  - !ruby/object:Gem::Dependency
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - ~>
34
34
  - !ruby/object:Gem::Version
35
- hash: 15424105
35
+ hash: 15424117
36
36
  segments:
37
37
  - 3
38
38
  - 1
39
39
  - 0
40
40
  - rc
41
- - 6
42
- version: 3.1.0.rc6
41
+ - 8
42
+ version: 3.1.0.rc8
43
43
  type: :runtime
44
44
  version_requirements: *id001
45
45
  description: SQL Server 2005 and 2008 Adapter For ActiveRecord