Today I Learned
Reduce label clickable area to text
How to bypass default_scope
Today I learned how to bypass default_scope using ActiveRecord::QueryMethods#unscope. And change a previously set where condition. Another helpful method is ActiveRecord::QueryMethods#rewhere
Force string to boolean object
Force Rails Database Migration
Clean up RSpec Global Namespace
Today I learned (after reading this article) that in RSpec declared classes, modules, and structs are global. They pollute the global namespace and can cause order dependent spec failures. You can read up more on the topic here. To avoid this you can this to your rails_helper.rb
Using SQL to find foreign key violations
Today I learned how to find and filter out rows from a query that violate a foreign key constraint on the table I am inserting data into. Now I can insert data without using INSERT IGNORE Given we are inserting data from a legacy system table with no constraints into a new system table with […]