Method: FlatMap::ModelMapper::Persistence#apply
- Defined in:
- lib/flat_map/model_mapper/persistence.rb
#apply(params) ⇒ Boolean
Write a passed set of params. Then try to save the model if self passes validation. Saving is performed in a transaction.
76 77 78 79 80 81 82 83 84 |
# File 'lib/flat_map/model_mapper/persistence.rb', line 76 def apply(params) write(params) res = if valid? ActiveRecord::Base.transaction do save end end !!res end |