Class: Notify

Inherits:
Object
  • Object
show all
Defined in:
lib/usernotification.rb

Class Method Summary collapse

Class Method Details



12
13
14
15
16
17
18
19
20
21
# File 'lib/usernotification.rb', line 12

def self.link(id,profiles)
        pro_id=profiles.find_by user_id: id.UID
        my_id=profiles.find_by user_id: id.user_id
    if id.kind=='follow'
        @linktonotification="/profiles/#{pro_id.id}"
    else
        @linktonotification="/profiles/#{my_id.id}/posts"
    end
    return @linktonotification
end

.read(id, profiles) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/usernotification.rb', line 2

def self.read(id,profiles)
    p=profiles.find_by_user_id(id.UID)
    if id.kind=='follow'
        @readnotification="#{p.fname} started following you."
    else
        @readnotification="#{p.fname} likes your post."
    end
    return @readnotification
end