Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Austin Vance

Posts By

LABS
[Standup][Boulder] 9/11/2012: I'm sick with your Errors

Interesting

class Dog < ActiveRecord::Base
  validates_presence_of :ball
end

fido = Dog.new
fido.valid?

rex = fido.dup
rex.ball = "tennis"
fido.valid?

fido.errors.empty? == false

Events

Ruby Group Tonight @ 6:30

PIVOTAL LABS
[Standup][Boulder] 9/10/2012: Net::Http left me hangin'

Interesting

  • If you would like to return a value from an ensure block you must explicitly return it

  • Net::Http#request does not leave a tcp connection open unless one is already started before calling request.

  • To make a BigInt in with a migration (at least with postgres) use limit: 8, anything higher will be ignored and a regular Int will be created

  • To make a BigInt in with a migration (at least with postgres) use limit: 8, anything higher will be ignored and a regular Int will be created

Events

  • Boulder Ruby Group @ Pivotal Boulder: tomorrow 7pm

LABS
[Standup][Boulder] 09/06/2012: If nothings going on call me.

Interesting

  • action_dispatch.show_exceptions = true will show exceptions in test.log for server exceptions with capybara.

  • Don't stub object under test... it is normally bad.

  • Enumerable#Detect will take a proc/lambda and call it if nothing is found. The same is true for Enumerable#find.

Events

  • Ruby group meet up next Tuesday.

LABS
[Standup][Boulder] 9/5/12 – Don't judge before you typecast

Helps

  • What is the fastest way to use a calculated column in a where clause with postgres?
SELECT (column1 + column2) AS super_column WHERE super_column > 1

Solutions:

  • use a sub query in the FROM
  • duplicate the logic for the calculated column

Like Woah

  • _before_type_cast lets you get to attributes of a model before they are type cast, useful for validations and calculations.

LABS
[Standup][Boulder] 8/21/12: Keep your brews fresh.

Helps

  • Installing postgres modules... We would like to use pg_trgrm and are looking for pointers and pain points installing pg_modules on dev and production systems. Anything will help.

Interestings

LABS
[Standup][Boulder] 8/27/12: What week is it again?

Helps

  • Any tips for reading HttpPerf?

  • LogReplay, any good gems or tips to replay requests from server logs?

Interestings

  • Jeff dean mentioned some strategies dealing with week based reporting, and the oddities that arise when week 0 bleeds into the next year.

    Use Date#strf_time

  Week number:
  The week 1 of YYYY starts with a Sunday or Monday (according to %U
  or %W).  The days in the year before the first week are in week 0.
    %U - Week number of the year.  The week starts with Sunday.  (00..53)
    %W - Week number of the year.  The week starts with Monday.  (00..53)

LABS
[Standup][Boulder] 08/23/12: Move a little down and to the right

Interestings

  • Active Record Calculations are Not scoped, be aware.

  • puts "v" is a newline and a tab character, for all your ascii art apps.

LABS
[Standup][Boulder] 08/21/12: Wanna redo the repeater?

Helps

  • Does anyone have any tips to get the Rails source running with all the ActiveRecord tests painlessly?

Interestings

  • rake db:migrate:redo does not generate a schema.rb so if you want your schema to reflect your current database rake db:migrate:redo db:schema:dump

LABS
[Standup][Boulder] 08/20/12: MailCatcher in the Rye

Helps

  • Rails runs very slowly on a brand new MacbookPro, something like 5 seconds to load the welcome to rails page. This happens when using Thin and WeBrick.

Hmm...

Interestings

  • jQuery $.each acts like Ruby's Object#tap.

  • Rails model.has_many_association.pluck will not scope to the model, it will just return the result of a SQL query for the attribute of the association's model. It will also not use any in memory objects are in the association but not in the database. So, be weary and use map.

  • MailCatcher is a gem that will catch all email sent from your app so you don't have to remember and create a bunch of unique emails. It also makes email debugging a snap.

  • jQuery pseudo selector :input will select all elements that can take a value. Useful for grabbing inputs and clearing forms.