Skip to content

Commit 8fadc7a

Browse files
author
Anna
committed
TODO's
1 parent 10ee811 commit 8fadc7a

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source 'https://rubygems.org'
44
if ENV['RAILS_SOURCE']
55
gemspec :path => ENV['RAILS_SOURCE']
66
else
7+
# Need to get rails source beacause the gem doesn't include tests
78
version = ENV['RAILS_VERSION'] || begin
89
require 'net/http'
910
require 'yaml'

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def rename_table(table_name, new_name)
5050

5151
def remove_column(table_name, column_name, type = nil)
5252
raise ArgumentError.new("You must specify at least one column name. Example: remove_column(:people, :first_name)") if (column_name.is_a? Array)
53-
ActiveSupport::Deprecation.warn 'Passing multiple arguments to remove_columns is deprecated, please use just one column name, like: `remove_columns(:posts, :column_name, :type)`', caller if column_name
53+
# TODO: this deprecation warning should be fixed or removed
54+
# ActiveSupport::Deprecation.warn 'Passing multiple arguments to remove_columns is deprecated, please use just one column name, like: `remove_columns(:posts, :column_name, :type)`', caller if column_name
5455
remove_check_constraints(table_name, column_name)
5556
remove_default_constraint(table_name, column_name)
5657
remove_indexes(table_name, column_name)
@@ -270,6 +271,8 @@ def get_table_name(sql)
270271
elsif sql =~ /FROM\s+([^\(\s]+)\s*/i
271272
$1
272273
else
274+
# TODO:
275+
puts sql
273276
nil
274277
end
275278
end

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ class SQLServerAdapter < AbstractAdapter
195195

196196
def initialize(connection, logger, pool, config)
197197
super(connection, logger, pool)
198+
# TODO: Is ActiveSupport::Notifications.notifier nil here
199+
# If it is not, does it become nil between here and 'SELECT @@version below'
200+
# If it is, why is it nil here, do we need to change our call to the super impl
198201
# AbstractAdapter Responsibility
199202
@schema_cache = Sqlserver::SchemaCache.new self
200203
@visitor = Arel::Visitors::SQLServer.new self
@@ -203,6 +206,13 @@ def initialize(connection, logger, pool, config)
203206
@connection_options = config
204207
connect
205208
@database_version = select_value 'SELECT @@version', 'SCHEMA'
209+
210+
# db_ver= "Microsoft SQL Server 2012 - 11.0.2100.60 (X64)
211+
# Feb 10 2012 19:39:15
212+
# Copyright (c) Microsoft Corporation
213+
# Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
214+
# "
215+
#TODO
206216
@database_year = begin
207217
if @database_version =~ /Azure/i
208218
@sqlserver_azure = true

lib/arel/visitors/sqlserver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class SQLServer < Arel::Visitors::ToSql
8989
private
9090

9191
# SQLServer ToSql/Visitor (Overides)
92-
92+
# TODO: Change for arel 4.0.1
9393
def visit_Arel_Nodes_SelectStatement(o)
9494
if complex_count_sql?(o)
9595
visit_Arel_Nodes_SelectStatementForComplexCount(o)

test/cases/session_test_sqlserver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'cases/sqlserver_helper'
22
require 'action_dispatch'
3-
require 'active_record/session_store'
4-
3+
# TODO: require 'active_record/session_store'
4+
# Active Record's Session Store extracted from Rails
55
module ActiveRecord
66
class SessionStore
77
class SessionTest < ActiveRecord::TestCase

0 commit comments

Comments
 (0)