profile_follower.rb
523 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 :group
belongs_to :profile, :foreign_key => :profile_id
belongs_to :follower, :class_name => 'Person', :foreign_key => :follower_id
validates_presence_of :profile_id, :follower_id
validates :profile_id, :uniqueness => {:scope => :follower_id, :message => "can't follow twice the same profile"}
end