Rails 7 has a rich API that allows you to update your ActiveRecord objects in several ways. Some methods have slightly different behavior which can sometimes result in unexpected consequences, so it’s important to understand their differences.
I came across an interesting problem recently where I was given a value and an array of “buckets” and I basically needed to return which bucket the value was closest to.
Sometimes you need to test the status code of a response in a controller, request, or feature spec. With the rspec-rails gem this can be done cleanly using the have_http_status matcher.
Sometimes within a Capybara test you need to verify that you are on a particular page. The obvious way to test for this is by making expectations against current_path or current_url.
Note: The dashboard and graphs outlined in this article are simplified examples of what I have used successfully in a production environment in the past. You should modify the dashboard and queries to fit your application’s specific needs.
Rails 6 has a rich API that allows you to update your ActiveRecord objects in several different ways. Some methods have slightly different behavior which can sometimes result in unexpected consequences so it’s important to understand their differences.
One problem that teams tend to run into with Rails apps on Heroku is forgetting to run database migrations before the code that depends on them is released.
Rails 5 has a rich API that allows you to update your ActiveRecord objects in several different ways. Some methods have slightly different behavior which can sometimes result in unexpected consequences so it’s important to understand their differences.