aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/support/connection.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add ability to change the names of the default handlersEileen Uchitelle2019-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When I wrote the `connected_to` and `connects_to` API's I wrote them with the idea in mind that it didn't really matter what the handlers/roles were called as long as those connecting to the roles knew which one wrote and which one read. With the introduction of the middleware Rails begins to assume it's `writing` and `reading` and there's no room for other roles. At GitHub we've been using this method for a long time so we have a ton of legacy code that uses different handler names `default` and `readonly`. We could rename all our code but I think this is better for a few reasons: - Legacy apps that have been using multiple databases for a long time can have an eaiser time switching. - If we later find this to cause more issues than it's worth we can easily deprecate. - We won't force old apps to rewrite the resolver middleware just to use a different handler. Adding the writing_role/reading_role required that I move the code that creates the first handler for writing to the railtie. If I didn't move this the core class would assign the handler before I was able to assign a new one in my configuration and I'd end up with 3 handlers instead of 2.
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* 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
|
* Handle non-existing $ARCONNKir Shatrov2017-02-271-1/+4
|
* fix #create_fixtures when equal table names in different databasesJulia Lopez2016-12-211-0/+1
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-6/+6
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* use correct DB connection for generated HABTM tableMatt Hanlon2015-08-071-0/+1
|
* Deprecate use of string in establish_connection as connection lookupJosé Valim2013-12-241-2/+2
|
* Remove ActiveRecord::ModelJon Leighton2012-10-261-3/+3
| | | | | | | | | | 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.
* Rotate the debug.log on each 100MBRafael Mendonça França2012-10-201-1/+1
|
* Revert "truncate debug.log on each test run"Yasuo Honda2012-10-201-2/+1
| | | | | | | | | This reverts commit 98043c689f945cabffc043f4bdc80ab2a7edc763. Because if every time `debug.log` is truncated, developers have no way to see the previous ActiveRecord unit test results. `debug.log` file can be easily reduced by executing `$ touch /dev/null > debug.log` periodically.
* truncate debug.log on each test runFrancesco Rodriguez2012-10-191-1/+2
|
* Use method compilation for association methodsJon Leighton2012-08-101-2/+2
| | | | | | | | | 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.
* Remove IdentityMapCarlos Antonio da Silva2012-03-131-1/+1
|
* added test for #3732Rick Martinez2012-02-101-1/+2
|
* Support establishing connection on ActiveRecord::Model.Jon Leighton2011-12-281-3/+3
| | | | | This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base.
* Changed the old logger to new active support loggerKarunakar (Ruby)2011-12-211-2/+2
|
* Print out information about whether the identity map is on or off when ↵Jon Leighton2011-06-091-1/+1
| | | | running unit tests
* Fix adapter_test.rb to make no assumptions about the database nameJon Leighton2011-06-051-2/+9
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-0/+13
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.