News for hackers. Stuff that matters.

TobiasBales

Re:Database mocks are just not worth it on Monday December 30, 2024 @04:05PM (#42553507)
I think one helpful thing is what rails calls transactional tests (https://guides.rubyonrails.org/testing.html#transactions). It basically does the database setup (migrations and seeds) and then executes the tests in a transaction that is rolled back at the end (and thus never committed). This helps with speed and also ensuring that tests don't have as much accidental codependence as they might otherwise.

If you use read replicas in production code this can become tricky though since the transactions don't commit they never become visible to the reader or even different connections to the same database

Re:Autotuner: How to Speed Up Your Rails App on Thursday April 25, 2024 @04:42PM (#40162744)
There is ruby-lsp and ruby-lsp-rails. For the former to shine you do need to use sorbet but for any moderate to large sized rails app I'd personally recommend it anyway. Yes it's not perfect, yes it has a learning curve but boy does it make refactoring easier, faster and safer.

ruby-lsp-rails builds on top of that and hands out information on models and routes mostly

Re:Project Gutenberg blocks access from Germany on Sunday March 04, 2018 @03:23AM (#16513768)
I am not using a VPN or anything and can access http://www.gutenberg.org/ just fine from germany (including access to books). Not sure why though.
Re:Project Gutenberg blocks access from Germany on Sunday March 04, 2018 @03:21AM (#16513760)
Does this apply to DMCA notices etc if a company is not based in the US too then?