Migrate files between ActiveStorage Providers with ease

There are several ways to migrate files between ActiveStorage Provider. I'm gonna use the mirroring way. First setup your new ActiveStorage provider. Let's say for the sake of this post we're going to migrate from local Disk based storage to S3.

Upload ActiveStorage files to nested S3 path

ActiveStorage doesn't support any kind of nesting inside S3 bucket (as of Rails v6.0). But without nesting, managing Multi Tenant application will be just plain hard. Specially is you use different database/schema per tenant.

AutoComplete Text Field in Flutter

AutoComplete is a nice feature for any possible input field, be it on Web or Mobile. In flutter you can implement a AutoComplete text field in various ways, starting from using your very own TextEditingController.

How to parse first and last name from full name

Sometimes we need to split a full name into first name and last name parts. In Ruby String#split is the default thinking. If the name is just two parts, like "John Doe" it'd work like breeze.

How to generate slug with multiple candidate in Rails

Whenever working with any kind of of CMS, human readable URL comes as a natural requirement. I used to use firendly_id for this. It's a solid gem for this purpose and featureful.

Rails UNIQUE INDEX allowing null or empty values

It's a common scenario we need to place a UNIQUE INDEX database constraint for data integrity. But sometime the requirements comes like we need to allow null/empty values for that column.