This is a checklist I use to work on issues. For this purpose I extracted several cards related to the...
In the past we validate and set default values for boolean attributes in Rails and not the database itself.
Carrierwave's BaseUploader can have some validations that you can use by overriding a certain method, which's expected name...
Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...
To retrieve only unique combinations of the selected attributes: You can omit rows, where all selected columns are equal with...
When you use the :as option to map a power to a controller method you can now override the generated...
Let's assume that we have a model Movie that registers a callback function when a new instance of Movie...
I recently enjoyed debugging a Cucumber step that tried to be retryable using a patiently block: Then /^"([^"]*)" should( not)? be...
Using ActiveRecord's #signed_id and .find_signed methods you can create URLs that expire after some time. No conditionals...
When an object is created / updated, various callbacks are executed in this order: before_validation after_validation before_save
Our CI setup frequently sees this error while running yarn install: yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages...
The cards editor has a feature "Cite other card" to create links to other cards in the same deck as...
tl;dr You should decouple migrations from models by embedding models into the migration. To use STI in this scenario...
As a developer you may have many tools watching your project for changes: Your IDE, Webpack, Guard, etc. This is...
Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...
This can happen with a very simple model: class Note has_many :attachments end Everything looks normal: Note.all.to_a.size # => 8 Note.all.ids.size...
ActiveType::Object inherits from ActiveRecod::Base and is designed to behave like an ActiveRecord Object, just without the database...
Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...
To allow HTTP 304 responses, Rails offers the fresh_when method for controllers. The most common way is to pass...
Greg Molnar has written a neat article about creating a single-file Rails app. This is not meant for production...
When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:
The linked content includes a few design patterns implemented with Ruby on Rails. What is the card indented to achieve...
This should be fixed in the latest LTS-branches of our mysql2 fork, 0.2.x-lts and 0.3.x-lts...
SELECT pg_size_pretty(pg_database_size('some-database')); Example SELECT pg_size_pretty(pg_database_size('cards_p')); ----------------