diaspora/app/models/author.rb
2010-07-22 20:16:24 -07:00

17 lines
392 B
Ruby

class Author
include MongoMapper::Document
key :service, String
key :feed_url, String
key :avatar_thumbnail, String
key :username, String
key :profile_url, String
many :ostatus_posts, :class_name => 'OstatusPost', :foreign_key => :author_id
def self.instantiate(opts)
author = Author.first(:feed_url => opts[:feed_url])
author ||= Author.create(opts)
end
end