-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We used to monkeypatch freely some classes. However, Rails is now supporting multiple databases, and these patches are in the way of this usage. Fixes #251
- Loading branch information
Showing
8 changed files
with
50 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "cases/helper_cockroachdb" | ||
require "models/account" | ||
|
||
module CockroachDB | ||
module ConnectionAdapters | ||
class TypeTest < ActiveRecord::TestCase | ||
fixtures :accounts | ||
class SqliteModel < ActiveRecord::Base | ||
establish_connection( | ||
adapter: "sqlite3", | ||
database: "tmp/some" | ||
) | ||
end | ||
def test_type_can_be_used_with_various_db | ||
assert_equal( | ||
:postgresql, | ||
ActiveRecord::Type.adapter_name_from(Account) | ||
) | ||
assert_equal( | ||
:sqlite3, | ||
ActiveRecord::Type.adapter_name_from(SqliteModel) | ||
) | ||
end | ||
end | ||
end | ||
end |
9 changes: 6 additions & 3 deletions
9
test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/QuotingTest.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
exclude :test_do_not_raise_when_int_is_not_wider_than_64bit, "replaced for correct quoting" | ||
exclude :test_do_not_raise_when_raise_int_wider_than_64bit_is_false, "replaced for correct quoting" | ||
exclude :test_raise_when_int_is_wider_than_64bit, "since integers are stringified there is not 64bit limit" | ||
comment = "This adapter quotes integers as string, as CRDB is capable of " \ | ||
"implicitely converting, and checking for out of bound errors. " \ | ||
"See quoting.rb for more information." | ||
exclude :test_do_not_raise_when_int_is_not_wider_than_64bit, comment | ||
exclude :test_do_not_raise_when_raise_int_wider_than_64bit_is_false, comment | ||
exclude :test_raise_when_int_is_wider_than_64bit, comment |