Skip to content
Extraits de code Groupes Projets
post.rb 489 octets
Newer Older
  • Learn to ignore specific revisions
  •   require 'lib/common'
    
    maxwell's avatar
    maxwell a validé
      include ApplicationHelper 
    
      # XML accessors must always preceed mongo field tags
    
    
    maxwell's avatar
    maxwell a validé
      include MongoMapper::Document
    
      include Diaspora::Webhooks
    
    maxwell's avatar
    maxwell a validé
      key :type, String
      key :person_id, ObjectId
    
    maxwell's avatar
    maxwell a validé
      belongs_to :person
    
    maxwell's avatar
    maxwell a validé
    
    
    maxwell's avatar
    maxwell a validé
      #before_create :set_defaults
    
    maxwell's avatar
    maxwell a validé
      after_save :send_to_view
    
    maxwell's avatar
    maxwell a validé
      def send_to_view
    
        self.reload
    
        WebSocket.update_clients(self)
    
    maxwell's avatar
    maxwell a validé
      end