Module: FollowmentManagement::ClassMethods

Defined in:
lib/social/followment_management.rb

Instance Method Summary (collapse)

Instance Method Details

- (ClassMethods) initialize

Returns a new instance of ClassMethods

Returns:



61
62
63
64
65
66
# File 'lib/social/followment_management.rb', line 61

def initialize
  has_many :followments, :dependent => :destroy
  has_many :followings, :class_name => 'Followment', :foreign_key => 'followed_id'
  has_many :followeds, :through => :followments, :source => :followed
  has_many :followers, :class_name => 'User', :through => :followings
end