Class: Like

Inherits:
Federated::Relayable show all
Defined in:
app/models/like.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Defined Under Namespace

Classes: Generator

Instance Method Summary collapse

Methods inherited from Federated::Relayable

#diaspora_handle, #diaspora_handle=, #parent, #parent=, #parent_class

Methods included from Diaspora::Relayable

#after_receive, #author_is_not_ignored, included, #initialize_signatures, #parent, #parent=, #parent_class, #parent_guid, #parent_guid=, #receive, #relayable?, #signature_valid?, #subscribers, #verify_parent_author_signature

Methods included from Diaspora::Encryptable

#sign_with_key, #signable_accessors, #signable_string, #verify_signature

Methods included from Diaspora::Guid

included, #set_guid

Methods included from Diaspora::Federated::Base

included

Instance Method Details

#notification_type(user, person) ⇒ Object


35
36
37
38
39
# File 'app/models/like.rb', line 35

def notification_type(user, person)
  #TODO(dan) need to have a notification for likes on comments, until then, return nil
  return nil if self.target_type == "Comment"
  Notifications::Liked if self.target.author == user.person && user.person != person
end