Module: Bigamy::Mongo::ClassMethods

Defined in:
lib/bigamy.rb

Instance Method Summary collapse

Instance Method Details

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



47
48
49
# File 'lib/bigamy.rb', line 47

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

#divorce_everyoneObject



42
43
44
45
# File 'lib/bigamy.rb', line 42

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

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



55
56
57
# File 'lib/bigamy.rb', line 55

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

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



51
52
53
# File 'lib/bigamy.rb', line 51

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