Class: ActiveRecord::Relation
- Inherits:
-
Object
- Object
- ActiveRecord::Relation
- Defined in:
- lib/choron_support/props/ext/relation.rb
Overview
Relationから直接as_propsを使えるようにコア拡張
Instance Method Summary collapse
Instance Method Details
#as_props(type_symbol = nil, **params) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/choron_support/props/ext/relation.rb', line 3 def as_props(type_symbol = nil, **params) if records.nil? return {} end records.map { |record| record.as_props(type_symbol, **params) } end |