RailsConf 2014 - Ultra Light and Maintainable Rails Wizards

Lance Ennen




RailsConf 2014 Recap: Day 4 with Aaron Patterson

Lance Ennen




RailsConf 2014 Recap: Day 3

Lance Ennen




Air Pair RailsConf 2014 Speaker Interview Andy Maleh

Lance Ennen




RailsConf 2014 Recap: Day 2

Lance Ennen




RailsConf 2014 Recap: Day 1

Lance Ennen




P9i0obgtek7liensdkhv

Riding Rails with a Composite Primary Key

Lance Ennen

So you've inherited this massive Oracle database full of sophisticated relationships, and started connecting it to your shiny new Ruby on Rails business intelligence application to ride fast on its productivity benefits. However, you got stumped and quite terrified when you noticed that after going through all the effort to convince your team and your boss to go with Rails over [insert legacy programming language framework], almost half the database tables use composite (compound) primary keys consisting of multiple columns each instead of Rails' expected ID column. The chief example is the LineItems table, which relies on both OrderID and ProductID to make up its primary key. Additionally, it includes a quantity column, so you could not hide it behind a has_and_belongs_to_many relationship with the excuse that it conceptually represents a many to many relationship between Orders and Products. Of course, you could add a simple primary key ID column, but then not only...




Awkfk5c3sjrpmqwobpxj

Big Astronaut at RailsConf 2014

Lance Ennen

Big Astronaut’s own Andy Maleh is presenting at RailsConf 2014! Will you be there?

We’re excited to see RailsConf come back to Chicago this year, and Big Astronaut will be there in full force. We’re always looking for *awesome* engineers to join our development team. Feel free to ask our team questions as you see them walking around with Big Astronaut t-shirts.

We’ll be kicking off Tuesday April 22, 2014 with David Heinemeier Hansson’s Keynote at 9:15am.

After the morning break, come check out Big Astronaut’s VP of Engineering, Andy Maleh’s, talk on "Ultra Light and Maintainable Rails Wizards”.

Ever wonder how to build an Ultra Light Rails Wizard?

Andy’s talk will cover the role of wizards in web applications since the dawn of the World Wide Web, the most notable being the humble Shopping Cart. Despite their prevalence, many developers struggle with writing effective and efficient wizard code, often resulting in an...




Kbz5uro2gjuruipcsdwf

Ruby SuperModule Comes To The Rescue!!

Lance Ennen

Tired of Ruby's modules not allowing you to mix in class methods easily? Tired of writing complex code and using complex libraries like ActiveSupport::Concern to accomplish that goal?

Well, worry no more! SuperModule comes to the rescue!!

SuperModule allows defining class methods and method invocations the same way a super class does without using def included(base).

This succeeds ActiveSupport::Concern by offering lighter purely idiomatic Ruby syntax and simpler module dependency support.

1. Just include SuperModule at the top of a module definition:

 module UserIdentifiable include SuperModule belongs_to :user validates :user_id, presence: true def self.most_active_user User.find_by_id(select('count(id) as head_count, user_id').group('user_id').order('count(id) desc').first.user_id) end def slug "#{self.class.name}_#{user_id}" end end

2. Mix newly defined module into a class or another super module

 class ClubParticipation <...



Yztf0h46ubukdrx77ysr

You're Hired! You're Fired!

Lance Ennen

What is the #1 thing everyone complains about with regards to using Heroku as a Rails Web Hosting platform?

If you guessed "price" you would not be far off from the truth. In fact, Heroku gives a lot of bang for the buck to get websites started and on the way to mega-stardom, but the inability to scale dynos up and down automatically based on web server load can be such a boon when you know the site is a ghost town at night not worth having 5 dynos fired up at $34/month each.

Enter HireFire: a dyno manager for Heroku, allowing you to autoscale your web and worker dynos, saving on server costs at nighttime and handling greater traffic during the day. It can integrate directly with NewRelic to get response times, request rates, and Apdex as data to use for scaling Heroku dynos automatically.

Testing

Very recently, I experimented with HireFire.io on a Staging web server for a Chicago healthy gourmet food site called Factor 75 (highly recommended approach to...