scraperwiki / scraperwiki-ruby

ScraperWiki Ruby library for scraping and saving data
https://quickcode.io
BSD 2-Clause "Simplified" License
12 stars 7 forks source link

[Bug] Changing Databases #18

Closed henare closed 10 years ago

henare commented 11 years ago

So I wanted, and expect to be able to, do this:

ScraperWiki.config = {db: 'some.db'}
ScraperWiki.select('* from swdata') # Gets data from some.db
ScraperWiki.config = {db: 'some_other.db'}
ScraperWiki.select('* from swdata') # Still gets data from some.db. Umm, whut?

but to my surprise the second query still gets data from the first one! This pull request allows the above behaviour, shouldn't change the API and, for bonus points:

henare commented 10 years ago

I've fixed another unrelated bug in this branch to allow boolean values to be saved (as used to happen automagically in ScraperWiki Classic).

I'd normally do this in a separate pull request branched off master, but the bug is reasonably simple and I thought that would be more effort than it was worth in this case.

pwaller commented 10 years ago

Hi @henare, apologies that this was never merged in the past. I'm now cleaning up old pull requests. Your pull request currently doesn't merge. Please reopen if you still want this and can rebase it against master.

Thanks!