Class: ActiveRecord::Associations::HasAndBelongsToManyAssociation
- Inherits:
-
Object
- Object
- ActiveRecord::Associations::HasAndBelongsToManyAssociation
- Defined in:
- lib/core_ext/habtm.rb
Instance Method Summary collapse
-
#find_or_create(object) ⇒ Object
Short alias for if exists then create.
Instance Method Details
#find_or_create(object) ⇒ Object
Short alias for if exists then create
4 5 6 |
# File 'lib/core_ext/habtm.rb', line 4 def find_or_create(object) self << object unless exists?(object) end |