aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/multiple_db_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin blockRyuta Kamizono2018-12-211-7/+5
| | | | | | | | | | Currently we sometimes find a redundant begin block in code review (e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205). I'd like to enable `Style/RedundantBegin` cop to avoid that, since rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5 (https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with that situation than before.
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Remove useless `arel_engine`Ryuta Kamizono2017-07-171-7/+2
| | | | | | | | | | | `arel_engine` is only used in `raise_record_not_found_exception!` to use `engine.connection` (and `connection.visitor`) in `arel.where_sql`. https://github.com/rails/arel/blob/v8.0.0/lib/arel/select_manager.rb#L183 But `klass.connection` will work as expected even if not using `arel_engine` (described by `test_connection`). So `arel_engine` is no longer needed.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-4/+4
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* s/specification_name/connection_specification_nameArthur Neves2016-05-061-2/+2
|
* s/specification_id/specification_nameArthur Neves2016-05-051-2/+2
|
* Test to swap connection at runtimeArthur Neves2016-05-051-0/+7
|
* Refactor connection handlerArthur Neves2016-05-051-2/+2
| | | | | | | | | | | | | | | ConnectionHandler will not have any knowlodge of AR models now, it will only know about the specs. Like that we can decouple the two, and allow the same model to use more than one connection. Historically, folks used to create abstract AR classes on the fly in order to have multiple connections for the same model, and override the connection methods. With this, now we can override the `specificiation_id` method in the model, to return a key, that will be used to find the connection_pool from the handler.
* remove args from assert_nothing_raised in testsTara Scherner de la Fuente2016-02-221-1/+1
|
* Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* Do not run remove_connection in memory db testRafael Mendonça França2015-02-051-7/+7
| | | | This will make rake test_sqlite3_mem work again
* Fix count on a separate connection (fixes #18359)brainopia2015-01-081-0/+7
| | | | | | | | Previosly count and other AR calculations would convert column_name_for_operation to sql on a default Arel::Table.engine (AR::Base) connection. That could lead to trouble if current model has a connection to a different adapter or Base connection is inaccessible.
* Deprecate use of string in establish_connection as connection lookupJosé Valim2013-12-241-1/+1
|
* Remove ActiveRecord::ModelJon Leighton2012-10-261-2/+2
| | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* Use method compilation for association methodsJon Leighton2012-08-101-3/+1
| | | | | | | | | Method compilation provides better performance and I think the code comes out cleaner as well. A knock on effect is that methods that get redefined produce warnings. I think this is a good thing. I had to deal with a bunch of warnings coming from our tests, though.
* Fix GH #5399. connection_pools's keys are ↵kennyj2012-03-141-1/+7
| | | | ActiveRecord::Base::ConnectionSpecification objects.
* Fix rake test_sqlite3_memJon Leighton2012-03-041-7/+9
|
* added test for #3732Rick Martinez2012-02-101-0/+12
|
* pools are 1:1 with spec now rather than 1:1 with classAaron Patterson2011-11-281-1/+0
|
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* Rename active_relation_engine -> arel_engine and active_relation_table -> ↵Pratik Naik2010-01-161-2/+2
| | | | arel_table
* Ensure using proper engine for Arel::TablePratik Naik2010-01-041-0/+6
|
* Move the transaction counter to the connection object rather than ↵Jonathan Viney2008-07-151-0/+25
| | | | | | | maintaining it on the current Thread. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#533 state:resolved]
* Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ↵Joshua Peek2008-06-031-1/+1
| | | | ActiveSupport [#238 state:resolved]
* Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/railsJeremy Kemper2008-01-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix pathsJeremy Kemper2008-01-181-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move tests to casesJeremy Kemper2008-01-181-0/+60
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de