Method: DataMapper::Collection#new
- Defined in:
- lib/dm-core/collection.rb
#new(attributes = {}) ⇒ Resource
Initializes a Resource and appends it to the Collection
778 779 780 781 782 |
# File 'lib/dm-core/collection.rb', line 778 def new(attributes = {}) resource = repository.scope { model.new(attributes) } self << resource resource end |