SQL is not a hard language, but the common usage of different ORM tools can make us less focused on clean SQL queries than ever.
This is why i wrote here a small cheatsheet with simple SQL commands.
Read moreSQL is not a hard language, but the common usage of different ORM tools can make us less focused on clean SQL queries than ever.
This is why i wrote here a small cheatsheet with simple SQL commands.
Read moreCopying data from ssh to local is not that hard:
scp -r admin@servername.com:domains/domain-name.pl/public_html/admin/backups admin/backups
This is how to copy from local to remote:
scp /Downloads/example_file.txt admin@servername.com:domains/domain-name.pl/public_html/admin/backups
You can use "-r" flag to copy full folder. Without this you can copy only one file.
Quick cheatsheet to kill your Rails session on port 3000
kill -9 $(lsof -i tcp:3000 -t)
Please take a note, that this is only brain shortcut for my personal use.
It won't tell you how to install and configure delayed job on your computer.
Read moreSometimes simple debugging with byebug is not enough and you need to dive deeper.
If you need to get the stacktrace you can simply use command:
Read moreIf you use rubocop and want to chain [.to change] matcher, it can be quite confusing.
Here is how you should do it correctly:
subject(:service_call) { my_service.call(car_id: id) }
let(:car) { create :car }
it "passes test" do
expect { service_call }.to(
change { car.brand }.to("Opel")
.and(change { car.model }.to("Astra")
.and(change { car.production_year }.to(1997),
)
end