Category: Design Patterns
-
Rely on Continuous Integration
If your testing process involves copying files over to a development environment and hoping you have the most up-to-date version of everything, stop now. There is a better way, and it is continuous integration.
-
Displaying Production-Only Markup in Rails
If you are running something like Google Analytics on your website, you probably don’t want its associated JavaScript code to appear in your web browser while you’re developing (it would skew your statistics). In Rails, it is incredibly simple to block off a segment of markup for specific environments by using the Rails.env variable.
-
Implementing Lazy Load Using a Proxy Class
Lazy load is a design pattern wherein an object is not instantiated until the last possible minute. This is very handy when working with lists of items whose contents are expensive to retrieve from the data store.