cirandas.net

ref: master

plugins/open_graph/lib/ext/profile_activity.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require_dependency 'profile_activity'

class ProfileActivity

  # update happens with grouped ActionTracker
  after_save :open_graph_publish

  def open_graph_publish
    # Scrap not yet supported
    if self.activity.is_a? ActionTracker::Record
      verb = self.activity.verb.to_sym
      return unless object = self.activity.target
      return unless stories = OpenGraphPlugin::Stories::TrackerStories[verb]
      OpenGraphPlugin::Stories.publish object, stories
    end
  end

end