activerecord-sqlserver-adapter 6.0.0.rc1 → 6.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +29 -0
- data/CHANGELOG.md +20 -0
- data/Gemfile +11 -5
- data/Guardfile +9 -8
- data/Rakefile +12 -16
- data/VERSION +1 -1
- data/activerecord-sqlserver-adapter.gemspec +3 -3
- data/lib/active_record/connection_adapters/sqlserver/core_ext/active_record.rb +0 -4
- data/lib/active_record/connection_adapters/sqlserver/core_ext/attribute_methods.rb +1 -4
- data/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb +3 -4
- data/lib/active_record/connection_adapters/sqlserver/core_ext/explain.rb +1 -3
- data/lib/active_record/connection_adapters/sqlserver/core_ext/finder_methods.rb +2 -3
- data/lib/active_record/connection_adapters/sqlserver/core_ext/query_methods.rb +2 -3
- data/lib/active_record/connection_adapters/sqlserver/database_statements.rb +35 -32
- data/lib/active_record/connection_adapters/sqlserver/database_tasks.rb +7 -12
- data/lib/active_record/connection_adapters/sqlserver/errors.rb +0 -3
- data/lib/active_record/connection_adapters/sqlserver/quoting.rb +8 -8
- data/lib/active_record/connection_adapters/sqlserver/schema_creation.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/schema_dumper.rb +7 -7
- data/lib/active_record/connection_adapters/sqlserver/schema_statements.rb +106 -103
- data/lib/active_record/connection_adapters/sqlserver/showplan.rb +6 -8
- data/lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb +2 -2
- data/lib/active_record/connection_adapters/sqlserver/showplan/printer_xml.rb +1 -1
- data/lib/active_record/connection_adapters/sqlserver/sql_type_metadata.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/table_definition.rb +1 -4
- data/lib/active_record/connection_adapters/sqlserver/transaction.rb +4 -8
- data/lib/active_record/connection_adapters/sqlserver/type.rb +35 -35
- data/lib/active_record/connection_adapters/sqlserver/type/big_integer.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/binary.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/boolean.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/char.rb +2 -2
- data/lib/active_record/connection_adapters/sqlserver/type/data.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/date.rb +2 -3
- data/lib/active_record/connection_adapters/sqlserver/type/datetime.rb +2 -3
- data/lib/active_record/connection_adapters/sqlserver/type/datetime2.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/datetimeoffset.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/decimal.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/float.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/integer.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/json.rb +0 -1
- data/lib/active_record/connection_adapters/sqlserver/type/money.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/real.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/small_integer.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/small_money.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/string.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/text.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/time.rb +2 -3
- data/lib/active_record/connection_adapters/sqlserver/type/time_value_fractional.rb +6 -9
- data/lib/active_record/connection_adapters/sqlserver/type/timestamp.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/tiny_integer.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_char.rb +1 -3
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_string.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_text.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_varchar.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_varchar_max.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/uuid.rb +1 -2
- data/lib/active_record/connection_adapters/sqlserver/type/varbinary.rb +1 -3
- data/lib/active_record/connection_adapters/sqlserver/type/varbinary_max.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/type/varchar.rb +1 -3
- data/lib/active_record/connection_adapters/sqlserver/type/varchar_max.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver/utils.rb +8 -11
- data/lib/active_record/connection_adapters/sqlserver/version.rb +0 -2
- data/lib/active_record/connection_adapters/sqlserver_adapter.rb +85 -83
- data/lib/active_record/connection_adapters/sqlserver_column.rb +0 -2
- data/lib/active_record/sqlserver_base.rb +1 -1
- data/lib/active_record/tasks/sqlserver_database_tasks.rb +26 -32
- data/lib/activerecord-sqlserver-adapter.rb +1 -1
- data/lib/arel/visitors/sqlserver.rb +18 -14
- data/lib/arel_sqlserver.rb +2 -2
- data/test/cases/adapter_test_sqlserver.rb +161 -182
- data/test/cases/change_column_null_test_sqlserver.rb +12 -12
- data/test/cases/coerced_tests.rb +88 -270
- data/test/cases/column_test_sqlserver.rb +281 -283
- data/test/cases/connection_test_sqlserver.rb +15 -20
- data/test/cases/execute_procedure_test_sqlserver.rb +18 -20
- data/test/cases/fetch_test_sqlserver.rb +14 -22
- data/test/cases/fully_qualified_identifier_test_sqlserver.rb +12 -18
- data/test/cases/helper_sqlserver.rb +13 -15
- data/test/cases/in_clause_test_sqlserver.rb +9 -9
- data/test/cases/index_test_sqlserver.rb +13 -15
- data/test/cases/json_test_sqlserver.rb +23 -25
- data/test/cases/migration_test_sqlserver.rb +22 -28
- data/test/cases/order_test_sqlserver.rb +51 -54
- data/test/cases/pessimistic_locking_test_sqlserver.rb +25 -33
- data/test/cases/rake_test_sqlserver.rb +31 -45
- data/test/cases/schema_dumper_test_sqlserver.rb +104 -108
- data/test/cases/schema_test_sqlserver.rb +18 -26
- data/test/cases/scratchpad_test_sqlserver.rb +2 -4
- data/test/cases/showplan_test_sqlserver.rb +24 -33
- data/test/cases/specific_schema_test_sqlserver.rb +66 -65
- data/test/cases/transaction_test_sqlserver.rb +16 -19
- data/test/cases/trigger_test_sqlserver.rb +12 -12
- data/test/cases/utils_test_sqlserver.rb +68 -70
- data/test/cases/uuid_test_sqlserver.rb +11 -13
- data/test/debug.rb +6 -6
- data/test/migrations/create_clients_and_change_column_null.rb +1 -1
- data/test/migrations/transaction_table/1_table_will_never_be_created.rb +2 -4
- data/test/models/sqlserver/booking.rb +1 -1
- data/test/models/sqlserver/customers_view.rb +1 -1
- data/test/models/sqlserver/dollar_table_name.rb +1 -1
- data/test/models/sqlserver/edge_schema.rb +1 -3
- data/test/models/sqlserver/fk_has_fk.rb +1 -1
- data/test/models/sqlserver/fk_has_pk.rb +1 -1
- data/test/models/sqlserver/natural_pk_data.rb +2 -2
- data/test/models/sqlserver/natural_pk_int_data.rb +1 -1
- data/test/models/sqlserver/no_pk_data.rb +1 -1
- data/test/models/sqlserver/object_default.rb +1 -1
- data/test/models/sqlserver/quoted_table.rb +2 -2
- data/test/models/sqlserver/quoted_view_1.rb +1 -1
- data/test/models/sqlserver/quoted_view_2.rb +1 -1
- data/test/models/sqlserver/sst_memory.rb +1 -1
- data/test/models/sqlserver/string_default.rb +1 -1
- data/test/models/sqlserver/string_defaults_big_view.rb +1 -1
- data/test/models/sqlserver/string_defaults_view.rb +1 -1
- data/test/models/sqlserver/tinyint_pk.rb +1 -1
- data/test/models/sqlserver/trigger.rb +2 -2
- data/test/models/sqlserver/trigger_history.rb +1 -1
- data/test/models/sqlserver/upper.rb +1 -1
- data/test/models/sqlserver/uppered.rb +1 -1
- data/test/models/sqlserver/uuid.rb +1 -1
- data/test/schema/sqlserver_specific_schema.rb +20 -22
- data/test/support/coerceable_test_sqlserver.rb +1 -4
- data/test/support/connection_reflection.rb +1 -2
- data/test/support/core_ext/query_cache.rb +1 -1
- data/test/support/load_schema_sqlserver.rb +3 -5
- data/test/support/minitest_sqlserver.rb +1 -1
- data/test/support/paths_sqlserver.rb +9 -11
- data/test/support/rake_helpers.rb +12 -10
- data/test/support/sql_counter_sqlserver.rb +0 -4
- data/test/support/test_in_memory_oltp.rb +7 -7
- metadata +5 -4
@@ -1,21 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "active_record/connection_adapters/sqlserver/showplan/printer_table"
|
4
|
+
require "active_record/connection_adapters/sqlserver/showplan/printer_xml"
|
5
5
|
|
6
6
|
module ActiveRecord
|
7
7
|
module ConnectionAdapters
|
8
8
|
module SQLServer
|
9
9
|
module Showplan
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
OPTION_XML = 'SHOWPLAN_XML'
|
10
|
+
OPTION_ALL = "SHOWPLAN_ALL"
|
11
|
+
OPTION_TEXT = "SHOWPLAN_TEXT"
|
12
|
+
OPTION_XML = "SHOWPLAN_XML"
|
14
13
|
OPTIONS = [OPTION_ALL, OPTION_TEXT, OPTION_XML]
|
15
14
|
|
16
15
|
def explain(arel, binds = [])
|
17
16
|
sql = to_sql(arel)
|
18
|
-
result = with_showplan_on { sp_executesql(sql,
|
17
|
+
result = with_showplan_on { sp_executesql(sql, "EXPLAIN", binds) }
|
19
18
|
printer = showplan_printer.new(result)
|
20
19
|
printer.pp
|
21
20
|
end
|
@@ -61,7 +60,6 @@ module ActiveRecord
|
|
61
60
|
else PrinterTable
|
62
61
|
end
|
63
62
|
end
|
64
|
-
|
65
63
|
end
|
66
64
|
end
|
67
65
|
end
|
@@ -43,7 +43,7 @@ module ActiveRecord
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def build_separator
|
46
|
-
|
46
|
+
"+" + @widths.map { |w| "-" * (w + (cell_padding * 2)) }.join("+") + "+"
|
47
47
|
end
|
48
48
|
|
49
49
|
def build_cells(items)
|
@@ -56,7 +56,7 @@ module ActiveRecord
|
|
56
56
|
|
57
57
|
def cast_item(item)
|
58
58
|
case item
|
59
|
-
when NilClass then
|
59
|
+
when NilClass then "NULL"
|
60
60
|
when Float then item.to_s.to(9)
|
61
61
|
else item.to_s.truncate(max_column_width)
|
62
62
|
end
|
@@ -4,7 +4,6 @@ module ActiveRecord
|
|
4
4
|
module ConnectionAdapters
|
5
5
|
module SQLServer
|
6
6
|
class SqlTypeMetadata < ActiveRecord::ConnectionAdapters::SqlTypeMetadata
|
7
|
-
|
8
7
|
def initialize(**kwargs)
|
9
8
|
@sqlserver_options = kwargs.extract!(:sqlserver_options)
|
10
9
|
super(**kwargs)
|
@@ -15,7 +14,6 @@ module ActiveRecord
|
|
15
14
|
def attributes_for_hash
|
16
15
|
super + [@sqlserver_options]
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
@@ -3,14 +3,12 @@
|
|
3
3
|
module ActiveRecord
|
4
4
|
module ConnectionAdapters
|
5
5
|
module SQLServer
|
6
|
-
|
7
6
|
module ColumnMethods
|
8
|
-
|
9
7
|
def primary_key(name, type = :primary_key, **options)
|
10
8
|
if [:integer, :bigint].include?(type)
|
11
9
|
options[:is_identity] = true unless options.key?(:default)
|
12
10
|
elsif type == :uuid
|
13
|
-
options[:default] = options.fetch(:default,
|
11
|
+
options[:default] = options.fetch(:default, "NEWID()")
|
14
12
|
options[:primary_key] = true
|
15
13
|
end
|
16
14
|
super
|
@@ -97,7 +95,6 @@ module ActiveRecord
|
|
97
95
|
def json(*names, **options)
|
98
96
|
names.each { |name| column(name, :text, **options) }
|
99
97
|
end
|
100
|
-
|
101
98
|
end
|
102
99
|
|
103
100
|
class TableDefinition < ActiveRecord::ConnectionAdapters::TableDefinition
|
@@ -1,12 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "active_record/connection_adapters/abstract/transaction"
|
4
4
|
|
5
5
|
module ActiveRecord
|
6
6
|
module ConnectionAdapters
|
7
|
-
|
8
7
|
module SQLServerTransaction
|
9
|
-
|
10
8
|
private
|
11
9
|
|
12
10
|
def sqlserver?
|
@@ -15,23 +13,22 @@ module ActiveRecord
|
|
15
13
|
|
16
14
|
def current_isolation_level
|
17
15
|
return unless sqlserver?
|
16
|
+
|
18
17
|
level = connection.user_options_isolation_level
|
19
18
|
# When READ_COMMITTED_SNAPSHOT is set to ON,
|
20
19
|
# user_options_isolation_level will be equal to 'read committed
|
21
20
|
# snapshot' which is not a valid isolation level
|
22
|
-
if level.blank? || level ==
|
23
|
-
|
21
|
+
if level.blank? || level == "read committed snapshot"
|
22
|
+
"READ COMMITTED"
|
24
23
|
else
|
25
24
|
level.upcase
|
26
25
|
end
|
27
26
|
end
|
28
|
-
|
29
27
|
end
|
30
28
|
|
31
29
|
Transaction.send :prepend, SQLServerTransaction
|
32
30
|
|
33
31
|
module SQLServerRealTransaction
|
34
|
-
|
35
32
|
attr_reader :starting_isolation_level
|
36
33
|
|
37
34
|
def initialize(connection, options, **args)
|
@@ -57,7 +54,6 @@ module ActiveRecord
|
|
57
54
|
connection.set_transaction_isolation_level(starting_isolation_level)
|
58
55
|
end
|
59
56
|
end
|
60
|
-
|
61
57
|
end
|
62
58
|
|
63
59
|
RealTransaction.send :prepend, SQLServerRealTransaction
|
@@ -1,48 +1,48 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "active_record/type"
|
4
4
|
# Behaviors
|
5
|
-
require
|
6
|
-
require
|
5
|
+
require "active_record/connection_adapters/sqlserver/type/data"
|
6
|
+
require "active_record/connection_adapters/sqlserver/type/time_value_fractional"
|
7
7
|
# Exact Numerics
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
8
|
+
require "active_record/connection_adapters/sqlserver/type/integer"
|
9
|
+
require "active_record/connection_adapters/sqlserver/type/big_integer"
|
10
|
+
require "active_record/connection_adapters/sqlserver/type/small_integer"
|
11
|
+
require "active_record/connection_adapters/sqlserver/type/tiny_integer"
|
12
|
+
require "active_record/connection_adapters/sqlserver/type/boolean"
|
13
|
+
require "active_record/connection_adapters/sqlserver/type/decimal"
|
14
|
+
require "active_record/connection_adapters/sqlserver/type/money"
|
15
|
+
require "active_record/connection_adapters/sqlserver/type/small_money"
|
16
16
|
# Approximate Numerics
|
17
|
-
require
|
18
|
-
require
|
17
|
+
require "active_record/connection_adapters/sqlserver/type/float"
|
18
|
+
require "active_record/connection_adapters/sqlserver/type/real"
|
19
19
|
# Date and Time
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
23
|
-
require
|
24
|
-
require
|
25
|
-
require
|
20
|
+
require "active_record/connection_adapters/sqlserver/type/date"
|
21
|
+
require "active_record/connection_adapters/sqlserver/type/datetime"
|
22
|
+
require "active_record/connection_adapters/sqlserver/type/datetime2"
|
23
|
+
require "active_record/connection_adapters/sqlserver/type/datetimeoffset"
|
24
|
+
require "active_record/connection_adapters/sqlserver/type/smalldatetime"
|
25
|
+
require "active_record/connection_adapters/sqlserver/type/time"
|
26
26
|
# Character Strings
|
27
|
-
require
|
28
|
-
require
|
29
|
-
require
|
30
|
-
require
|
31
|
-
require
|
27
|
+
require "active_record/connection_adapters/sqlserver/type/string"
|
28
|
+
require "active_record/connection_adapters/sqlserver/type/char"
|
29
|
+
require "active_record/connection_adapters/sqlserver/type/varchar"
|
30
|
+
require "active_record/connection_adapters/sqlserver/type/varchar_max"
|
31
|
+
require "active_record/connection_adapters/sqlserver/type/text"
|
32
32
|
# Unicode Character Strings
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
36
|
-
require
|
37
|
-
require
|
33
|
+
require "active_record/connection_adapters/sqlserver/type/unicode_string"
|
34
|
+
require "active_record/connection_adapters/sqlserver/type/unicode_char"
|
35
|
+
require "active_record/connection_adapters/sqlserver/type/unicode_varchar"
|
36
|
+
require "active_record/connection_adapters/sqlserver/type/unicode_varchar_max"
|
37
|
+
require "active_record/connection_adapters/sqlserver/type/unicode_text"
|
38
38
|
# Binary Strings
|
39
|
-
require
|
40
|
-
require
|
41
|
-
require
|
39
|
+
require "active_record/connection_adapters/sqlserver/type/binary"
|
40
|
+
require "active_record/connection_adapters/sqlserver/type/varbinary"
|
41
|
+
require "active_record/connection_adapters/sqlserver/type/varbinary_max"
|
42
42
|
# Other Data Types
|
43
|
-
require
|
44
|
-
require
|
45
|
-
require
|
43
|
+
require "active_record/connection_adapters/sqlserver/type/uuid"
|
44
|
+
require "active_record/connection_adapters/sqlserver/type/timestamp"
|
45
|
+
require "active_record/connection_adapters/sqlserver/type/json"
|
46
46
|
|
47
47
|
module ActiveRecord
|
48
48
|
module Type
|
@@ -5,7 +5,6 @@ module ActiveRecord
|
|
5
5
|
module SQLServer
|
6
6
|
module Type
|
7
7
|
class Char < String
|
8
|
-
|
9
8
|
def type
|
10
9
|
:char
|
11
10
|
end
|
@@ -13,6 +12,7 @@ module ActiveRecord
|
|
13
12
|
def serialize(value)
|
14
13
|
return if value.nil?
|
15
14
|
return value if value.is_a?(Data)
|
15
|
+
|
16
16
|
Data.new super, self
|
17
17
|
end
|
18
18
|
|
@@ -25,9 +25,9 @@ module ActiveRecord
|
|
25
25
|
|
26
26
|
def quoted(value)
|
27
27
|
return value.quoted_id if value.respond_to?(:quoted_id)
|
28
|
+
|
28
29
|
Utils.quote_string_single(value)
|
29
30
|
end
|
30
|
-
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -5,7 +5,6 @@ module ActiveRecord
|
|
5
5
|
module SQLServer
|
6
6
|
module Type
|
7
7
|
class Data
|
8
|
-
|
9
8
|
attr_reader :value, :type
|
10
9
|
|
11
10
|
def initialize(value, type)
|
@@ -29,7 +28,6 @@ module ActiveRecord
|
|
29
28
|
self.class == other.class && self.value == other.value
|
30
29
|
end
|
31
30
|
alias :== :eql?
|
32
|
-
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -5,13 +5,13 @@ module ActiveRecord
|
|
5
5
|
module SQLServer
|
6
6
|
module Type
|
7
7
|
class Date < ActiveRecord::Type::Date
|
8
|
-
|
9
8
|
def sqlserver_type
|
10
|
-
|
9
|
+
"date"
|
11
10
|
end
|
12
11
|
|
13
12
|
def serialize(value)
|
14
13
|
return unless value.present?
|
14
|
+
|
15
15
|
date = super(value).to_s(:_sqlserver_dateformat)
|
16
16
|
Data.new date, self
|
17
17
|
end
|
@@ -39,7 +39,6 @@ module ActiveRecord
|
|
39
39
|
def fast_string_to_date_format
|
40
40
|
::Date::DATE_FORMATS[:_sqlserver_dateformat]
|
41
41
|
end
|
42
|
-
|
43
42
|
end
|
44
43
|
end
|
45
44
|
end
|
@@ -5,7 +5,6 @@ module ActiveRecord
|
|
5
5
|
module SQLServer
|
6
6
|
module Type
|
7
7
|
class DateTime < ActiveRecord::Type::DateTime
|
8
|
-
|
9
8
|
include TimeValueFractional
|
10
9
|
|
11
10
|
def sqlserver_type
|
@@ -15,7 +14,7 @@ module ActiveRecord
|
|
15
14
|
def serialize(value)
|
16
15
|
value = super
|
17
16
|
return value unless value.acts_like?(:time)
|
18
|
-
|
17
|
+
|
19
18
|
datetime = "#{value.to_s(:_sqlserver_datetime)}.#{quote_fractional(value)}"
|
20
19
|
|
21
20
|
Data.new datetime, self
|
@@ -36,7 +35,7 @@ module ActiveRecord
|
|
36
35
|
private
|
37
36
|
|
38
37
|
def fast_string_to_time(string)
|
39
|
-
time = ActiveSupport::TimeZone[
|
38
|
+
time = ActiveSupport::TimeZone["UTC"].strptime(string, fast_string_to_time_format)
|
40
39
|
new_time(time.year, time.month, time.day, time.hour,
|
41
40
|
time.min, time.sec, Rational(time.nsec, 1_000))
|
42
41
|
rescue ArgumentError
|
@@ -5,7 +5,6 @@ module ActiveRecord
|
|
5
5
|
module SQLServer
|
6
6
|
module Type
|
7
7
|
class DateTimeOffset < DateTime2
|
8
|
-
|
9
8
|
def type
|
10
9
|
:datetimeoffset
|
11
10
|
end
|
@@ -17,7 +16,6 @@ module ActiveRecord
|
|
17
16
|
def quoted(value)
|
18
17
|
Utils.quote_string_single(value)
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|
@@ -5,7 +5,6 @@ module ActiveRecord
|
|
5
5
|
module SQLServer
|
6
6
|
module Type
|
7
7
|
class Decimal < ActiveRecord::Type::Decimal
|
8
|
-
|
9
8
|
def sqlserver_type
|
10
9
|
"decimal".yield_self do |type|
|
11
10
|
type += "(#{precision.to_i},#{scale.to_i})" if precision || scale
|
@@ -16,7 +15,6 @@ module ActiveRecord
|
|
16
15
|
def type_cast_for_schema(value)
|
17
16
|
value.is_a?(BigDecimal) ? value.to_s : value.inspect
|
18
17
|
end
|
19
|
-
|
20
18
|
end
|
21
19
|
end
|
22
20
|
end
|