Class: Mongoid::Associations::EmbedsMany
- Inherits:
-
Object
- Object
- Mongoid::Associations::EmbedsMany
- Defined in:
- lib/monkeypatch_for_mongoid_1.9.rb
Instance Method Summary collapse
Instance Method Details
#find_or_create_by(attr) ⇒ Object
4 5 6 |
# File 'lib/monkeypatch_for_mongoid_1.9.rb', line 4 def find_or_create_by(attr) where(attr).first || create(attr) end |