Skip to content

Commit a06b28b

Browse files
committed
[Rails3] Adding ruby-debug for development. Notes on next steps for relation debugging.
1 parent 84de6e0 commit a06b28b

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ group :development do
77
gem 'rake'
88
gem 'mocha', '0.9.8'
99
gem 'shoulda', '2.10.3'
10+
gem 'ruby-debug', '0.10.3'
1011
end

RAILS3_NOTES

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,43 @@ on a local branch of our remote tracking branch.
3434

3535
= SQL Server Todo
3636

37-
2364 tests, 9484 assertions, 7 failures, 44 errors
37+
/opt/local/bin/ruby -w -I"lib:test:test/connections/native_mysql" "/Users/kencollins/.bundle/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/cases/associations/join_model_test.rb"
38+
39+
/opt/local/bin/ruby -I"lib:test:test/connections/native_sqlserver_odbc:/Users/kencollins/Repositories/rails/activerecord/test" "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/cases/aaaa_create_tables_test_sqlserver.rb" "test/cases/table_name_test_sqlserver.rb"
40+
41+
# Post.preload(:comments).to_a
42+
# SELECT [posts].* FROM [posts]
43+
# SELECT [comments].* FROM [comments] WHERE ([comments].post_id IN (1,2,3,4,5,6,7))
44+
45+
# Post.includes(:comments).to_a
46+
# SELECT [posts].* FROM [posts]
47+
# SELECT [comments].* FROM [comments] WHERE ([comments].post_id IN (1,2,3,4,5,6,7))
48+
49+
# Author.find :first, :conditions => ['name = ?', 'David'], :include => :comments, :order => 'comments.id'
50+
# count = posts(:thinking).tags.count
51+
52+
53+
2389 tests, 9552 assertions, 9 failures, 32 errors
3854

3955
* SQL Server Test Cases
4056
x inheritance_test_sqlserver.rb (1) Recheck orig.
4157
x method_scoping_test_sqlserver.rb (1) Recheck orig.
4258

4359
* Verify coerced tests
44-
Undefined coerced test: EagerAssociationTest#test_eager_with_has_many_and_limit_and_high_offset_and_multiple_array_conditions
45-
Undefined coerced test: EagerAssociationTest#test_eager_with_has_many_and_limit_and_high_offset_and_multiple_hash_conditions
46-
Undefined coerced test: EagerAssociationTest#test_count_with_include
47-
Undefined coerced test: AttributeMethodsTest#test_typecast_attribute_from_select_to_false
48-
Undefined coerced test: AttributeMethodsTest#test_typecast_attribute_from_select_to_true
49-
Undefined coerced test: BasicsTest#test_read_attributes_before_type_cast_on_datetime
50-
Undefined coerced test: CalculationsTest#test_should_sum_expression
51-
Undefined coerced test: InheritanceTest#test_a_bad_type_column
52-
Undefined coerced test: InheritanceTest#test_eager_load_belongs_to_primary_key_quoting
53-
Undefined coerced test: NestedScopingTest#test_merged_scoped_find
54-
Undefined coerced test: MigrationTest#test_add_column_not_null_without_default
55-
Undefined coerced test: ChangeTableMigrationsTest#test_string_creates_string_column
56-
Undefined coerced test: QueryCacheTest#test_cache_does_not_wrap_string_results_in_arrays
60+
- Undefined coerced test: EagerAssociationTest#test_eager_with_has_many_and_limit_and_high_offset_and_multiple_array_conditions
61+
- Undefined coerced test: EagerAssociationTest#test_eager_with_has_many_and_limit_and_high_offset_and_multiple_hash_conditions
62+
- Undefined coerced test: EagerAssociationTest#test_count_with_include
63+
- Undefined coerced test: AttributeMethodsTest#test_typecast_attribute_from_select_to_false
64+
- Undefined coerced test: AttributeMethodsTest#test_typecast_attribute_from_select_to_true
65+
- Undefined coerced test: BasicsTest#test_read_attributes_before_type_cast_on_datetime
66+
- Undefined coerced test: CalculationsTest#test_should_sum_expression
67+
- Undefined coerced test: InheritanceTest#test_a_bad_type_column
68+
- Undefined coerced test: InheritanceTest#test_eager_load_belongs_to_primary_key_quoting
69+
√ Undefined coerced test: NestedScopingTest#test_merged_scoped_find
70+
- Undefined coerced test: MigrationTest#test_add_column_not_null_without_default
71+
- Undefined coerced test: ChangeTableMigrationsTest#test_string_creates_string_column
72+
- Undefined coerced test: QueryCacheTest#test_cache_does_not_wrap_string_results_in_arrays
73+
* Move all sqlserver_adapter/core_ext files to sqlserver/core_ext.
5774
* Make sure the repair special columns was good to go.
5875
* Possibly remove 2000 support and query methods.
5976
* Make sure Gemspec is good.

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ def supports_primary_key?
207207
true
208208
end
209209

210+
def supports_count_distinct?
211+
true
212+
end
213+
210214
def supports_ddl_transactions?
211215
true
212216
end

test/cases/sqlserver_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Bundler.setup
1212
require 'shoulda'
1313
require 'mocha'
14+
require 'ruby-debug'
1415
[ File.expand_path(File.join(File.dirname(__FILE__),'..','..','test')),
1516
File.expand_path(File.join(File.dirname(__FILE__),'..','..','test','connections','native_sqlserver_odbc')),
1617
File.expand_path(File.join(ENV['RAILS_SOURCE'],'activerecord','test'))

0 commit comments

Comments
 (0)