Here's a quick hack (thanks to Mike), put this at the top of your seeds.rb:
# Dodge the mass assignment User.send(:attr_accessible, :username) User.send(:attr_accessible, :admin)
Now you can easily call it without cluttering your model (using: as =>: seed):
@user = User.find_or_create_by_username(:username => 'ryanonrails', :admin => true)
source share