Skip to content
Extraits de code Groupes Projets
profile.rb 726 octets
Newer Older
  • Learn to ignore specific revisions
  •   include MongoMapper::EmbeddedDocument
    
      require 'lib/diaspora/webhooks'
      include Diaspora::Webhooks
    
      xml_reader :person_id
    
      xml_accessor :first_name
      xml_accessor :last_name
    
    maxwell's avatar
    maxwell a validé
      xml_accessor :image_url
    
      key :first_name, String
      key :last_name, String
    
      key :image_url, String
    
      validates_presence_of :first_name, :last_name
    
    maxwell's avatar
    maxwell a validé
      # before_save :expand_profile_photo_path
      # 
      # 
      # def expand_profile_photo_path
      #   unless image_url.nil? || self.image_url.include?(parent_document.url)
      #     self.image_url = self._parent_document.url + self.image_url
      #   end
      # end
    
      def person_id
        self._parent_document.id
      end
      
      def to_diaspora_xml
        self.to_xml.to_s
      end
    
    maxwell's avatar
    maxwell a validé