Uncategorized
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 […]
Grand Canyon River Trip
This summer I had the chance to visit the Grand Canyon for the first time. I thought what better way to see it then riding on the Grand Canyon River for more than 200 miles. Here are a some photos I got from the trip.