cherry-pick db/seeds from rails 4 branch, fix rails 3.2 compatability issues to close #914

Conflicts:
	db/seeds.rb