Module: ArrayExtender
- Included in:
- Array
- Defined in:
- lib/opt_ar/core_ext/array.rb
Overview
Extender to add functionality to Array class to make optars
method available for an array of ActiveRecord objects,
returning array of `OAR`s which we generate
Instance Method Summary collapse
- #optars(options = {}) ⇒ Object (also: #opt_ar_objects)
Instance Method Details
#optars(options = {}) ⇒ Object Also known as: opt_ar_objects
5 6 7 8 9 10 11 12 |
# File 'lib/opt_ar/core_ext/array.rb', line 5 def optars( = {}) map do |obj| unless obj.is_a? ActiveRecord::Base raise OptAR::Errors::NonActiveRecordError end obj.optar() end end |