Skip to content

Instantly share code, notes, and snippets.

@obfuscurity
Created November 30, 2011 14:04
Show Gist options
  • Save obfuscurity/1409169 to your computer and use it in GitHub Desktop.
Save obfuscurity/1409169 to your computer and use it in GitHub Desktop.
003_BootstrapAccount.rb for blog post
# migrations/003_BootstrapAccount.rb
Sequel.migration do
up do
timestamp = Time.now
self[:users].insert(
:username => "admin@foobar.com",
:password => "$2a$10$BpKGMuwioxQrfvkS0HPglOq3hTf1tvhY6KDdaFe3UynbxsvHTzDTm",
:api_token => "87bdbcb0-fb92-012e-a61c-109addaa2672",
:confirm_token => "92da4870-fb92-012e-a61c-109addaa2672",
:enabled => true,
:confirmed => true,
:created_at => timestamp,
:updated_at => timestamp,
:confirmed_at => timestamp
)
self[:accounts].insert(
:owner_id => 1,
:name => "system",
:enabled => true,
:created_at => timestamp,
:updated_at => timestamp
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment