Skip to content

Instantly share code, notes, and snippets.

@jccarbonfive
Created May 31, 2012 18:49
Show Gist options
  • Select an option

  • Save jccarbonfive/2845362 to your computer and use it in GitHub Desktop.

Select an option

Save jccarbonfive/2845362 to your computer and use it in GitHub Desktop.
# started at
create :up_vote_activity, created_at: 1.day.from_now
create :comment_activity, created_at: 1.day.from_now
# introduce local
created_at = 1.day.from_now
create :up_vote_activity, created_at: created_at
create :comment_activity, created_at: created_at
# Object#tap to scope local
1.day.from_now.tap do |created_at|
create :up_vote_activity, created_at: created_at
create :comment_activity, created_at: created_at
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment