Quantcast
Channel: Software Habit
Browsing latest articles
Browse All 11 View Live

Ruby Tips #359 – Root Node for ActiveModel Serializers

To override your root nodes for ActiveModel serializers without a global config use the following. This makes a consistent API for clients regardless of model but still leaves your code flexible. #...

View Article



Ruby Tips #360 – Bang Bang Boolean

Ruby provides syntax for a !! boolean. In this example let’s extend this to a class default for our Yummy class. class Yummy   def initialize @dinner_defined = false end   def some_fudz...

View Article

Ruby Tips #361 – Access Heroku psql without Gems

One of the things making your Heroku hosted database, certainly from a remote box, or a console difficult is the need to get an application running with the Heroku gems. This means also means your...

View Article

Ruby Tips #362 – Super and Parentheses

Most the time in Ruby parentheses are optional for parameters in method calls. Here is one case where you can expect the unexpected. class Course def track puts 'masters' end end   class Elective <...

View Article

Ruby Tips #363 – Eql? versus == with Numerics

These two operator in Ruby look similar but can have different results when comparing Numeric operators. 1.0 == 1 #=> true 1.eql? 1 #=> false As stated in the docs only override the ‘==’ if...

View Article


Ruby Tips #364 – Cool Console Counter

This tip comes by way of: @starvo. By using a counter in your ruby console script you can gain insight into long running actions for your application. @photos = Photo.all count = @photos.count...

View Article

Ruby Tips #365 – OMFG A Year of Ruby Tips

Today marks the end of a 365 day journey of writing one Ruby programming tip everyday. It has been a long journey to consider new and interesting content in the realm of a Ruby and Rails programmer. I...

View Article

Curb Your Refactor

Refactoring is a necessity in software development. As engineers, our first attempt at writing new feature code is most likely filled with rats. Then we refactor the code to make it maintainable,...

View Article


Engineering Guidelines for Teams

After observing millions of dollars wasted and made, companies close, and lives disrupted I have adopted these lessons. Your business is not immune from the problems of modern knowledge work. It does...

View Article


Should I Use Rails in 2018

tl;dr Yes. Ruby on Rails has been a production-ready framework since its maturation phase in 2008. When Rails became deployable without an operations team. We gained dangerous ground in the community....

View Article
Browsing latest articles
Browse All 11 View Live




Latest Images