Tutorials
How to deal with complex Factory Bot associations in RSpec tests
What’s the best way to handle tests that involve complex setup data? You want to test object A but it needs database records for objects B, C and D first.I’ll describe how I address this issue but first let me point out why complex setup data is a...
Migrate tags in Rails to PostgreSQL array from ActsAsTaggableOn
ActsAsTaggableOn is a swiss army knife solution if you need to add tags to your ActiveRecord model.Just by adding one gem to your Gemfile and acts_as_taggable to the model you get everything you need: adding tags, searching for a model by tag, get...