cirandas.net

ref: master

plugins/open_graph/models/open_graph_plugin/enterprise_track_config.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class OpenGraphPlugin::EnterpriseTrackConfig < OpenGraphPlugin::TrackConfig

  # workaround for STI bug
  self.table_name = :open_graph_plugin_tracks

  self.track_name = :enterprise

  self.static_trackers = true

  def self.trackers_to_profile enterprise
    trackers = enterprise.members.to_set
    trackers.merge enterprise.fans if enterprise.respond_to? :fans
    trackers.to_a
  end

  def self.profile_track_objects profile
    (profile.enterprises.is_public.enabled + profile.favorite_enterprises.is_public.enabled).uniq
  end

end