def new
    if current_user.has_credit_card_on_file?
      redirect_to edit_user_billing_path, :notice => "We've detected that you already have a credit card on file, please edit the details below"
...

Ruby Feels like an easy refactor...

by https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co, August 18, 2011 08:44, 2 refactorings, tagged with rails3 controller

I've got the method below w...

1772298f2d14152c13bbd3221e6ab6ec Talk

ActionScript On Combining certain attribute...

by https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co, June 03, 2011 15:45

Ahh, of course, seems so si...

1772298f2d14152c13bbd3221e6ab6ec Talk
summary.detentionComments = []; 
   $.map(summary.detentionNotes, function(note) { summary.detentionComments.push(note.comments) });
   summary.detentionComments = summary.detentionComments.join("; ");

ActionScript Combining certain attribute...

by https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co, June 03, 2011 11:37, 2 refactorings, tagged with jquery javascript arrays

I just can't help but feel ...

1772298f2d14152c13bbd3221e6ab6ec Talk
def matched_members
    matched_members = []
    availabilities.each do |availability|  
...

Ruby Rails join refactor

by https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co, February 24, 2011 23:12, No refactoring, tagged with rails activerecord joins

I'm trying to do a join bet...

1772298f2d14152c13bbd3221e6ab6ec Talk
$("#browsable .items:not(img.active)").hover(
		function() { $(this).attr("src", $(this).attr("src").match(/[^\.]+/) + "_hover.png"); },
		function() { $(this).attr("src", $(this).attr("src").replace("_hover", "")); }
...

JavaScript jQuery ugly rollover code

by https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co, September 24, 2010 15:24, 1 refactoring, tagged with hover click jquery binding

I have this jQuery code I w...

1772298f2d14152c13bbd3221e6ab6ec Talk
if @user.valid?
      ....
      result = create_customer
...

Ruby Redundant Else Clauses

by https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co, August 05, 2010 19:19, 3 refactorings, tagged with rails, conditionals

Hi,
I have a controller wh...

1772298f2d14152c13bbd3221e6ab6ec Talk
def self.status_name(status)
    holder = []
    Issue.all.each do |record|
...

Ruby Named Scope Trouble

by https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co, July 15, 2010 01:40, 2 refactorings, tagged with named_scope ruby rails

Hi,
A partner and I were t...

1772298f2d14152c13bbd3221e6ab6ec Talk