10 May '12, 8pm

#Data #Analysis A Fresh Cup - Home - #Seed #Data in #Rails 3 #rails3 #k9bay #rubyonrails

One of the perennial code smells in many Rails applications is the use of migrations as a way to carry seed data (data that needs to be added to the database on deployment). This doesn't work well because it's tough to maintain and doesn't play well with loading up the database from the schema file. Rails 3 now has a new answer to this : a file convention and a rake task. The file is db/seeds.rb and it can contain arbitrary Ruby code, but generally it will look something like this: [sourcecode language='ruby'] cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) Mayor.create(:name => 'Daley', :city => cities.first) [/sourcecode] This file then gets run by using the new db:seed rake task, or via rake db:setup which runs create, schema:load, and seed in succession. As with some other parts of Rails, this is the simplest thing that can possibly work. For ...

Full article: http://afreshcup.com/home/2009/5/11/seed-data-in-rails-3....

Tweets

Here's your way to a Perfect Summer! <3

Here's your way to a Perfect Summer! <3

We were extremely pleased to have chance upon this precious, the sequin collar is a conversation starter for sure. A hot s...

Google, Big Data & What it Means for SEO

searchenginewatch.com 08 May '12, 11am

In Google’s recent earnings call, the question was posed, “If you think of the future of Internet search 3 or 4 years out,...

What’s New in Edge Rails #20: Week of May 7 – M...

afreshcup.com 14 May '12, 11am

As usual, I'm only pulling out the things that look most interesting to developers using Rails; there's a great deal of wo...

How Big Data Changed Crime Fighting & Is Changing The Practice Of SEO

How Big Data Changed Crime Fighting & Is Changi...

searchengineland.com 11 May '12, 5pm

In the mid 1990’s, New York city Mayor Rudolph Giuliani introduced a technology-based crime measurement system called Comp...

UP Singapore – Improving our urban environments through technology and data

UP Singapore – Improving our urban environments...

sgentrepreneurs.com 09 May '12, 4am

Over the past couple of months, in the Singapore entrepreneurship and tech startup space, there have been activities and b...

A Fresh Cup:What's New in Edge Rails #19

afreshcup.com 07 May '12, 11am

is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting in the univer...

td-client (0.8.16): Treasure Data API library f...

rubygems.org 10 May '12, 8pm

td-client 0.8.16 Treasure Data API library for Ruby install gem install td-client Download Documentation Subscribe Stats A...

#ruby can do native UIs: https://t.co/Z6P6Ouob ...

macruby.org 17 May '12, 2am

HotCocoa is a thin, idiomatic Ruby layer that sits above Cocoa and other frameworks. HotCocoa is currently included in the...

Ruby on Rails Guides: A Guide to Testing Rails ...

guides.rubyonrails.org 08 May '12, 9am

Testing support was woven into the Rails fabric from the beginning. It wasn’t an “oh! let’s bolt on support for running te...

A Fresh Cup:What's New in Edge Rails #21

afreshcup.com 21 May '12, 11am

Monday, May 21, 2012 at 5:31AM Week of May 14 - May 20, 2012 In addition to the code changes below, I want to mention the ...

My first post for the @railsmachine blog!

railsmachine.com 11 May '12, 8pm

Hi, my name is Kevin Lawver and I’ve been at Rails Machine for almost a month now. I would have written a blog post sooner...

Upload CSV in Rails 3 and test with capybara

rubyflow.com 03 May '12, 8am

Upload CSV in Rails 3 and test with capybara Posted by spyou on May 03, 2012 — 0 comments Again a new take on an old probl...

A Fresh Cup:Double Shot #875

afreshcup.com 08 May '12, 10am

Tuesday, May 8, 2012 at 5:51AM My Cub Scouts say they want to do more camping, fishing, whittling, and science. Gonna be a...