Posts tagged with "rails"

11 posts found

Rails Testing: Reload the Model

2 min read

A beginner in Rails might find themselves testing a model and not seeing the attributes reflecting the changes they would expect to see. Read about why this problem happens and how you can resolve it by reloading the model.

Testing the Use of Rails Caching

3 min read

There is a strong test culture for Rubyist using Rails. Caching can be rewarding in performance, yet can introduce cache complexities. Read about how I approach testing low-level caching.

Information at a Glance: RailsRequestStats

3 min read

RailsRequestStats provides a simple drop-in solution to expose more statistics on requests. New information is presented in your development logs, supplying you with the required information to iteratively optimize requests by noticing subtle changes in the number of queries and average runtimes.

Sidekiq: Contained Callbacks

4 min read

ActiveJob in Rails provides nice benefits. The background queueing gem Sidekiq allows for tailored options that you cannot use with ActiveJob. This post looks at a project's transition from ActiveJob to Sidekiq, and how to fill the missing functionality of ActiveJob Callbacks. By the end, we come up with a way to contain the callback logic to their own modules without modifying the concrete jobs.

Let's pry into Ruby Objects

4 min read

When you are knee deep in Ruby and dealing with objects that you never created it's sometimes a little daunting to trace everything back and figure it all out. Luckly there are a couple techniques in Ruby that can aid you. In particular, pry is an extreamly powerful tool that you should have in your toolbox.