We'll introduce new database_tasks.rb and register tasks api since rails 4.0.
Thus, I think we should extract and deprecate firebird / sqlserver / oracle database tasks because they should be supported by 3rd-party adapters.
/cc @rafaelfranca @carlosantoniodasilva @yahonda
👍 @yahonda any objections?
@tenderlove what do you think?
this is cool!
Will take a look at this.
cc / @metaskills I think you maintain sql server adapter.
Fine by me, we have always had to hack around these anyway. Would much rather prefer the new proposed API.
Hi, I've merged these commits into my sandbox branch and tested. Every database adapter (sqlite, mysql, mysql2, postgresql and oracle) this test gets error.
TypeError: can't convert Tempfile into StringIO
Here are all outputs.
https://gist.github.com/yahonda/5270973 I'm okay to merge this pull request if these errors resolved.
@yahonda Thank you for testing ! I can reproduce above error, and I'm going to fix it.
I've updated commits to fix the above error. I used capture method instead of swapping $stderr in testcase
Thanks for the update. All errors have gone.
Is this an expected behavior to show deprecation messages every time, rake test_sqlite3 and other bundled adapters are tested?
I don't think so.
@yahonda thanks for your comment. I've confirmed it. I'm going to check one tonight. Now I'm working on holiday ;)
@yahonda @rafaelfranca I've udpated deprecation warning problem. I added 2b32b0597ab082404c9146892912c31014c075a0.
I thought no D.R.Y., but above code will be removed. So I left duplicated code alone.
@kennyj Thanks for making a fix.
2b32b05 mutes all deprecated messages not only for bundled adapters (sqlite3, mysql, mysql2 and postgresql) but for Oracle enhanced adapter. I do not have SQLServer or Firebird database environments, it should mute deprecate messages for these adapters also.
What I meant to say was this deprecate message should appear when Oracle, Firebird and SQLServer adapters are tested. but it should not appear when bundled adapters (sqlite3, mysql, mysql2 and postgresql) are tested.
I was trying to make a fixusing current_adapter? but actually these tests use Mocha::Mock adapter, then made a commit using if adapter names are defined or not.
Here are both outputs.
rake test_oracle output and rake test output
This output is what I expected whatever the way it is implemented.
@yahonda thanks. I agree with your commit.
I want to remove 2b32b05
and add your commit . But your commit depend on my commit .
Could you provide a commit without dependency ?
or should I fix my commit ?
Yes my commit needs your 2b32b05. I do not think you need to revert/remove 2b32b05. I think it should be fine your pull request includes yahonda@beff312. Would you cherry pick yahonda@beff312 and update your pull request?
@yahonda ok. I'm going to include your commit. Thanks :)
I've updated my PR again :) I included @yahonda 's commit.
Great @kennyj. Now we need a CHANGELOG entry
Extract Firebird database tasks.
Extract Sqlserver database tasks.
Extract Oracle database tasks.
Add deprecation message on Firebird / Sqlserver / Oracle database tasks.
Suppress deprecation messages for deprecated database tasks, when exe…
…cuting rails's testcases.
@rafaelfranca I've added a CHANGELOG entry .
@kennyj could you squash these two commits? kennyj@24e093f kennyj@2f33670
Fix tiny problem: change method order for consistency and fix wrong m…
Show deprecated messages only when target database adapters defined
Add CHANGELOG entry about extracting and deprecating Firebird/Sqlserv…
…er/Oracle database tasks.
@rafaelfranca I've updated again :)
Thanks guys !