26 Dec '13, 11pm

Get Your Callbacks On with Factory Girl 3.3:

Get Your Callbacks On with Factory Girl 3.3 Josh Clayton May 15, 2012 factory girl callbacks rails testing FactoryGirl 3.3.0 was released this weekend with a slew of improvements. To install, add (or change) your Gemfile: gem 'factory_girl_rails', '~> 3.3.0' New Callback Syntax Callbacks have been revamped to work well in conjunction with custom strategies. Instead of declaring callbacks like this: FactoryGirl.define do factory :user do factory :user_with_posts do after_create {|instance| create_list(:post, 5, user: instance) } end end end you can declare callbacks with before and after , passing the symbol of the callback as the name: FactoryGirl.define do factory :user do after(:custom) {|instance| instance.do_something_custom! } factory :user_with_posts do after(:create) {|instance| create_list(:post, 5, user: instance) } end end end Finally, you can use completely cust...

Full article: http://robots.thoughtbot.com/get-your-callbacks-on-with-f...

Tweets

A new year, a new you! Refresh your fitness rou...

payless.com 27 Dec '13, 8pm

You are currently accessing your account through Payless.com. Would you like to visit our Canadian site? Continue to Canad...

What every girl needs to keep her keys safe! A ...

twitter.com 26 Dec '13, 9am

To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content,...

Girl poses in Army No.4 -- without the pants

singaporeseen.stomp.com.sg 27 Dec '13, 3am

STOMPer RR came across this picture online of a girl dressed in Army No.4 uniform -- sans the pants. The STOMPer felt it w...

Completely new to Raspberry Pi? Get started here:

element14.com 26 Dec '13, 3pm

If you’re completely new to Raspberry Pi, then we’re here to help. Here you will find easy to understand guides, simple pr...

30mins of agony: How girl's hand was freed from sugar cane juicer

30mins of agony: How girl's hand was freed from...

soshiok.com 26 Dec '13, 7am

He had just bought a sugar cane machine for his drinks stall. But tragedy struck when the stallholder's daughter got her r...

crease within 2 wears. "@sneakernews: Did you g...

twitter.com 30 Dec '13, 3am

To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content,...

New #FDA Guidance on Factory Farm Antibiotics T...

organicconsumers.org 25 Dec '13, 8pm

For related articles and more information, please visit OCA's CAFO's vs. Free Range page and our Food Safety Research Cent...

Why Does it Take So Long to Get an Android OS Update?

Why Does it Take So Long to Get an Android OS U...

soyacincau.com 27 Dec '13, 9am

Beyond uncovering the process behind getting a software update delivered to the end user, the site also lists down the upd...

"Prime" from @ZiGishoes Girl is pure Pimp!

"Prime" from @ZiGishoes Girl is pure Pimp!

heels.com 28 Dec '13, 12am

Show off perfection in the Prime by ZiGi Soho. A boot and a shoe comes together for the perfect look, created with a synth...

#PeopleTree Want to get this so badly.

#PeopleTree Want to get this so badly.

peopletree.co.uk 28 Dec '13, 6pm

People Tree products are made with great care and skill, so we hope that you are pleased with your purchase. Athough we ma...

Cleanup up your factory girl with traits.

robots.thoughtbot.com 21 Dec '13, 11am

Remove Duplication with FactoryGirl's Traits Josh Clayton May 24, 2012 factory girl testing traits ruby rails FactoryGirl ...