activerecord-sqlserver-adapter 5.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13700d5c59ccddfde7189f1bf0dfac4bbd276777
4
- data.tar.gz: e9cafb310dfe9904c39dbf77ccc5bb86687f231a
3
+ metadata.gz: 378063f22d136e43bd1ed0f9bc52eb8958ccfb30
4
+ data.tar.gz: 97a3056adb1e8502d4e0c59ab6ce8a7367532651
5
5
  SHA512:
6
- metadata.gz: 2cbb63f122e3ad2657532e7649c33728a0790f945043a12afdb078d171122970636a81dfa621485aa6a8abe7d30b9ab3892d2fef76fefd0a7ed6019fbda543dd
7
- data.tar.gz: 220bc1f5a936151978885af18c38f7a25d7e684f0d7199c64d21d30922c4b33b8312e2a0db924f59d3040b0b147bbc6fa4dc564b5e1fbe6bb190daa522b322b4
6
+ metadata.gz: d0fa22bb008d291d299b5d3cd9b9df7d94880076f0ca6de524036551e7a7a3d145a6472d53e6709b30d67a01bc44e7c7095583dcee107f6340f05e593cdabc7a
7
+ data.tar.gz: e1ed20a3214446b06a99aecab587f7163cffcdb0d6036669598ece9f0c162e6e6cca213202248ecb7239ac563cf218abf1b415bebc767278aa636e5bf84d2f94
@@ -1,7 +1,12 @@
1
- ## v5.1.0
1
+ ## v5.1.1
2
2
 
3
3
  #### Fixed
4
4
 
5
+ * Use `ActiveSupport.on_load` to hook into ActiveRecord Fixes #588 #598
6
+
7
+
8
+ ## v5.1.0
9
+
5
10
  #### Changed
6
11
 
7
12
  * The `drop_table` with force cascade option now mimics in via pure SQL for us.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.0
1
+ 5.1.1
@@ -24,4 +24,6 @@ module ActiveRecord
24
24
  end
25
25
  end
26
26
 
27
- ActiveRecord::Base.send :include, ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::ActiveRecord
27
+ ActiveSupport.on_load(:active_record) do
28
+ include ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::ActiveRecord
29
+ end
@@ -22,4 +22,6 @@ module ActiveRecord
22
22
  end
23
23
  end
24
24
 
25
- ActiveRecord::Base.send :include, ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::AttributeMethods
25
+ ActiveSupport.on_load(:active_record) do
26
+ include ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::AttributeMethods
27
+ end
@@ -43,5 +43,7 @@ module ActiveRecord
43
43
  end
44
44
  end
45
45
 
46
- ActiveRecord::Base.extend ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::Explain
47
- ActiveRecord::Relation.send :include, ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::Explain
46
+ ActiveSupport.on_load(:active_record) do
47
+ extend ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::Explain
48
+ ActiveRecord::Relation.include(ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::Explain)
49
+ end
@@ -1,4 +1,6 @@
1
- silence_warnings do
2
- # Already defined in Rails
3
- ActiveRecord::ExplainSubscriber::EXPLAINED_SQLS = /(select|update|delete|insert)\b/i
1
+ ActiveSupport.on_load(:active_record) do
2
+ silence_warnings do
3
+ # Already defined in Rails
4
+ ActiveRecord::ExplainSubscriber::EXPLAINED_SQLS = /(select|update|delete|insert)\b/i
5
+ end
4
6
  end
@@ -25,7 +25,7 @@ module ActiveRecord
25
25
  do_execute "DELETE FROM #{quote_table_name(fktable)} WHERE #{quote_column_name(fkcolmn)} IN ( SELECT #{quote_column_name(pkcolmn)} FROM #{quote_table_name(pktable)} )"
26
26
  end
27
27
  end
28
- if options[:if_exists] && @version_year != 2016
28
+ if options[:if_exists] && @version_year < 2016
29
29
  execute "IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = #{quote(table_name)}) DROP TABLE #{quote_table_name(table_name)}"
30
30
  else
31
31
  super
@@ -3,7 +3,7 @@
3
3
  set -x
4
4
  set -e
5
5
 
6
- tag=1.4
6
+ tag=2.0
7
7
 
8
8
  docker pull metaskills/mssql-server-linux-rails:$tag
9
9
 
@@ -9,12 +9,6 @@ class SpecificSchemaTestSQLServer < ActiveRecord::TestCase
9
9
  SSTestDollarTableName.limit(20).offset(1)
10
10
  end
11
11
 
12
- it 'handle dot table names' do
13
- SSTestDotTableName.create! name: 'test'
14
- SSTestDotTableName.limit(20).offset(1)
15
- SSTestDotTableName.where(name: 'test').first.must_be :present?
16
- end
17
-
18
12
  it 'models can use tinyint pk tables' do
19
13
  obj = SSTestTinyintPk.create! name: '1'
20
14
  ['Fixnum', 'Integer'].must_include obj.id.class.name
@@ -64,10 +64,6 @@ ActiveRecord::Schema.define do
64
64
  t.uuid :uuid_nil_default, default: nil
65
65
  end
66
66
 
67
- create_table '[some.Name]', force: true do |t|
68
- t.varchar :name
69
- end
70
-
71
67
  create_table 'sst_my$strange_table', force: true do |t|
72
68
  t.string :name
73
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-05-29 00:00:00.000000000 Z
17
+ date: 2017-06-21 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -167,7 +167,6 @@ files:
167
167
  - test/models/sqlserver/datatype.rb
168
168
  - test/models/sqlserver/datatype_migration.rb
169
169
  - test/models/sqlserver/dollar_table_name.rb
170
- - test/models/sqlserver/dot_table_name.rb
171
170
  - test/models/sqlserver/edge_schema.rb
172
171
  - test/models/sqlserver/fk_has_fk.rb
173
172
  - test/models/sqlserver/fk_has_pk.rb
@@ -259,7 +258,6 @@ test_files:
259
258
  - test/models/sqlserver/datatype.rb
260
259
  - test/models/sqlserver/datatype_migration.rb
261
260
  - test/models/sqlserver/dollar_table_name.rb
262
- - test/models/sqlserver/dot_table_name.rb
263
261
  - test/models/sqlserver/edge_schema.rb
264
262
  - test/models/sqlserver/fk_has_fk.rb
265
263
  - test/models/sqlserver/fk_has_pk.rb
@@ -1,3 +0,0 @@
1
- class SSTestDotTableName < ActiveRecord::Base
2
- self.table_name = '[dbo].[some.Name]'
3
- end