Login as various users during development can become pretty annoying especially since it’s very difficult to remember all of the passwords across users or apps. If your app authentication happen to be built with Sorcery here’s is a very easy and straightforward way how to implement auto login. Continue reading
Webpacker can pretend everything went smooth with the compilation… until one loads a page with
I decided to write a book (at the very least attempt to). And yes, there will be some Fedora inside! Continue reading
A quick fix for an annoying (and not very descriptive) error Browsing context has been discarded when setting up Ruby on Rails system tests with Firefox headless.
This is a simple example of adding a conditional and partial unique index to Rails applications backed by PostgreSQL.
Database migrations are the tricky part of any deployment. They make zero-time deploys problematic. They requires special attention since they can break stuff. Some might choose to run migrations automatically, some of us run them manually. But one thing is almost always true; the production code without migrations should not ever run. So how not to run your code without doing migrations first?
At work we use ActiveModel::Serializer to serialize ActiveRecord objects into JSON:API-like responses for our APIs. The problem is that ActiveModel::Serializer is clever enough to dasherize our hash keys (so they can be accessed as properties instead of  brackets syntax) and our hash keys are actually real keys that we have to serve untouched. Continue reading
After some time with
1.0.0.rc1 I am releasing a final
1.0.0 of InvoicePrinter. So what it is it, what does it mean and what’s next? Continue reading
If you are using Ruby on Rails together with Devise gem you might be wondering
how to handle unauthorized error responces in your JSON API. Continue reading
This a very short note on setting up Capybara to correctly follow redirects with Rails classic
redirect_to @object pattern. Continue reading