Slide 61
Slide 61 text
“Active” MVC.
class Timeline < ActiveRecord::Base!
!
after_save :notify_views!
!
def websockets_channel!
"#{ self.class }#{ self.id }".hash!
end!
!
private!
!
def notify_views!
Pusher.trigger(self.websockets_channel, 'update',
{ self: self.to_json })!
end!
end!