Posts Tagged "Ruby"
Last updated 24 August 2016
Fat models, skinny controllers is out of fashion in the rails world in favor of many smaller use case classes, but fat models don't happen all at once. Peter shows how to trim the fat out of your models step by step.
Last updated 10 August 2016
Locking is one of the most powerful tools in a developers chest to ensure data consistency, but it the documentation can be confusing. Peter guides you through how to use it properly with examples.
Last updated 20 July 2016
When moving from toy apps with fake data to production apps with real data that can't be lost, it can be hard to know how to adjust your database schema. Peter explains a few simple steps to make it happen seamlessly.
Last updated 13 July 2016
There are a lot of shortcuts to understanding include and extend in ruby, but it can help to really understand how it all works. Peter explains.
Last updated 29 June 2016
So much of programming is learning the jargon programmers use. Learn what an N+1 query is, how to identify them in your code, and how to avoid generating them.
Last updated 13 September 2015
Keep your instance variables hidden, but changeable, with private attr_readers
Last updated 08 September 2015
Use dependency injection to only test the things you care about
Last updated 21 June 2015
There are many benefits of using named arguments in Ruby
Last updated 18 June 2015
An explanation of the Object#tap method in Ruby and why you should use it
Last updated 12 February 2015
How to find the greatest item in a group in ActiveRecord and Rails
Last updated 10 January 2015
An introduction to a new gem that improves redirecting back in Rails
Last updated 18 October 2014
A guide to a very complicated ActiveRecord query from a Rails app
Last updated 11 October 2014
A brief guide to routing with Rails and AngularJS