Module: Bigamy::Mongo::ClassMethods
- Defined in:
- lib/bigamy.rb
Instance Method Summary collapse
- #belongs_to_ar(name, options = {}) ⇒ Object
- #divorce_everyone ⇒ Object
- #has_many_ar(name, options = {}) ⇒ Object
- #has_one_ar(name, options = {}) ⇒ Object
Instance Method Details
#belongs_to_ar(name, options = {}) ⇒ Object
47 48 49 |
# File 'lib/bigamy.rb', line 47 def belongs_to_ar name, = {} bigamy_associations[name] = MongoBelongsTo.new(self, name, ) end |
#divorce_everyone ⇒ Object
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, = {} bigamy_associations[name] = MongoHasMany.new(self, name, ) end |
#has_one_ar(name, options = {}) ⇒ Object
51 52 53 |
# File 'lib/bigamy.rb', line 51 def has_one_ar name, = {} bigamy_associations[name] = MongoHasOne.new(self, name, ) end |