18 Oct '12, 9pm

A refactoring story with a happy ending: "An eCommerce Refactor…" on the @engineyard blog

“We can’t add any more features”, I said to Cillian. We had reached that point when building a web app using Rails that if we added another line to that controller, I couldn’t help but feel the whole thing would come crashing down, like placing the last block in a game of Jenga. “We need to refactor.” The code in question was extremely common code: handling customer payments. Like many, many eCommerce setups out there, we wanted to be able to accept payment by PayPal, or by credit card. Since we also wanted to support multiple stores, we wanted to accept multiple payment gateways. The purchase controller logic looked a bit like this: class PurchasesController def create @purchase = Purchase.new( params[ :purchase] ) if @purchase.free? if @purchase.confirm redirect_to @purchase else render :new end else if @purchase.paypal? redirect_to_paypal elsif @purchase.credit_card? if...

Full article: http://www.engineyard.com/blog/2012/ecommerce-rails/

Tweets

An eCommerce Refactor: Cleaning up a Common Pat...

engineyard.com 18 Oct '12, 9pm

“We can’t add any more features”, I said to Cillian. We had reached that point when building a web app using Rails that if...

Data Science at Engine Yard

engineyard.com 25 Oct '12, 8pm

There’s nothing glamorous about it. You are not a rockstar, but a janitor. You will clean a lot of data. A LOT. Most peopl...

e-Commerce Custom CMS - Ruby on Rails by Adrena...

freelancer.com 30 Oct '12, 5pm

Freelancer.com (formerly GetAFreelancer) is the world's largest outsourcing and crowdsourcing marketplace for small busine...

Sneakers Story

Sneakers Story

tokyobanhbao.com 21 Oct '12, 8pm

J’ai également jeté mon dévolu sur les baskets à l’imprimé « touches de piano », plus originales et fun (Elles me font pen...

Reality of Data Science

engineyard.com 25 Oct '12, 7pm

There’s nothing glamorous about it. You are not a rockstar, but a janitor. You will clean a lot of data. A LOT. Most peopl...

Approaching 5th anniversary, 2,000th post, revisiting day one @dotearth: Why a Blog, and Why This Blog? #dotchat

Approaching 5th anniversary, 2,000th post, revi...

dotearth.blogs.nytimes.com 22 Oct '12, 1am

Through 25 years of communicating about climate change, conservation, industry, farming, fishing, disasters, technology an...

Announcing Engine Yard Buffalo

engineyard.com 24 Oct '12, 6pm

Engine Yard is excited to announce the opening of its office in Buffalo, NY on October 1, 2012! The Buffalo space is our p...

e-Commerce quiz (beginner level): What's wrong with this web page?

e-Commerce quiz (beginner level): What's wrong ...

mrcoffee.com 24 Oct '12, 1pm

Recommend Product: 12-Cup, Black, Replacement Decanter Model: PLD12-2 close X Your message to your friend will read: I tho...

Is your #eCommerce site ready for holiday shopp...

networksolutions.com 23 Oct '12, 8pm

Test your site. Make sure the nuts and bolts are working and that load speeds are up to par. Help ‘em out. Can consumers q...

"Love this article. I am a big evangelist of us...

searchengineland.com 14 Oct '12, 3am

Which video recipe will make your cash register ring more often and more loudly? It was the end of a 12-hour video shoot. ...