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

Conflicts:
	db/seeds.rb
Merge branch 'master' into rails-4

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

Conflicts:
	db/seeds.rb