chaps-io/public_activity

View on GitHub
lib/public_activity/orm/active_record/trackable.rb

Summary

Maintainability
A
0 mins
Test Coverage
module PublicActivity
  module ORM
    module ActiveRecord
      # Implements {PublicActivity::Trackable} for ActiveRecord
      # @see PublicActivity::Trackable
      module Trackable
        # Creates an association for activities where self is the *trackable*
        # object.
        def self.extended(base)
          base.has_many :activities, :class_name => "::PublicActivity::Activity", :as => :trackable
        end
      end
    end
  end
end