Module: Bigamy::ActiveRecord::ClassMethods

Defined in:
lib/bigamy.rb

Instance Method Summary collapse

Instance Method Details

#belongs_to_mm(name, options = {}) ⇒ Object



99
100
101
# File 'lib/bigamy.rb', line 99

def belongs_to_mm name, options = {}
  bigamy_associations[name] = ARBelongsTo.new(self, name, options)
end

#divorce_everyoneObject



94
95
96
97
# File 'lib/bigamy.rb', line 94

def divorce_everyone
  self.bigamy_associations.each {|k,v| v.divorce_everyone }
  self.bigamy_associations.clear
end

#has_many_mm(name, options = {}) ⇒ Object



107
108
109
# File 'lib/bigamy.rb', line 107

def has_many_mm name, options = {}
  bigamy_associations[name] = ARHasMany.new(self, name, options)
end

#has_one_mm(name, options = {}) ⇒ Object



103
104
105
# File 'lib/bigamy.rb', line 103

def has_one_mm name, options = {}
  bigamy_associations[name] = ARHasOne.new(self, name, options)
end