profile_follower.rb 622 Bytes
class ProfileFollower < ApplicationRecord
  track_actions :new_follower, :after_create, :keep_params => ["follower.name", "follower.url", "follower.profile_custom_icon"], :custom_user => :profile

  attr_accessible :profile, :follower, :follow_category

  belongs_to :profile, :foreign_key => :profile_id
  belongs_to :follower, :class_name => 'Person', :foreign_key => :follower_id
  belongs_to :follow_category, :foreign_key => :follow_category_id

  validates_presence_of :profile_id, :follower_id
  validates :profile_id, :uniqueness => {:scope => :follower_id, :message => "can't follow the same profile twice"}

end