Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e06e00d937
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (24 sloc) 0.608 kb
class Account < ActiveRecord::Base
has_many :names
has_many :nicks
has_many :sites
has_many :services
has_many :portraits
has_many :books
###
# Import +io+ object that contains a YAML representation of the
# ruby-committers
def self.import io
require 'psych'
doc = Psych.load io
doc.each do |record|
account = Account.create!(:username => record['account'])
record['name'].each do |name|
account.names.create!(:value => name)
end
(record['nick'] || []).each do |name|
account.nicks.create!(:value => name)
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.