DG IZ albums are now posts

This commit is contained in:
ilya 2010-08-18 16:59:19 -07:00
parent 516a667ce4
commit 803de25cc0
2 changed files with 2 additions and 37 deletions

View file

@ -1,16 +1,8 @@
class Album
require 'lib/diaspora/webhooks'
include MongoMapper::Document
include ROXML
include Diaspora::Webhooks
include Encryptable
class Album < Post
xml_reader :name
xml_reader :person, :as => Person
xml_reader :_id
key :name, String
belongs_to :person, :class_name => 'Person'
many :photos, :class_name => 'Photo', :foreign_key => :album_id
timestamps!
@ -19,11 +11,6 @@ class Album
before_destroy :destroy_photos
before_destroy :propagate_retraction
def self.instantiate params
self.create params
end
def self.mine_or_friends(friend_param, current_user)
if friend_param
@ -44,30 +31,9 @@ class Album
p_photo ? p_photo : self.photos.sort(:created_at.desc).last
end
#ENCRYPTION
xml_accessor :creator_signature
key :creator_signature, String
def signable_accessors
accessors = self.class.roxml_attrs.collect{|definition|
definition.accessor}
accessors.delete 'person'
accessors.delete 'creator_signature'
accessors
end
def signable_string
signable_accessors.collect{|accessor|
(self.send accessor.to_sym).to_s}.join ';'
end
protected
def destroy_photos
photos.each{|p| p.destroy}
self.photos.each{|p| p.destroy}
end
def propagate_retraction
self.person.owner.retract(self)
end
end

View file

@ -1,5 +1,4 @@
class StatusMessage < Post
#include StatusMessagesHelper
xml_name :status_message
xml_accessor :message