Module: Worldwise::ActiveRecord::ActsAsNeighbor

Defined in:
lib/worldwise/active_record/acts_as_neighbor.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_neighborObject



4
5
6
7
8
# File 'lib/worldwise/active_record/acts_as_neighbor.rb', line 4

def acts_as_neighbor
  attr_accessible :neighbor_ids
  has_many :neighborships, as: :owner
  has_many :neighbors, through: :neighborships, as: :neighbor, source: :neighbor, source_type: self.name
end