Module: BettyResource::Model::Property::Types::HasMany
- Includes:
- Association
- Defined in:
- lib/betty_resource/model/property/types/has_many.rb
Instance Method Summary collapse
Instance Method Details
#collection? ⇒ Boolean
8 9 10 |
# File 'lib/betty_resource/model/property/types/has_many.rb', line 8 def collection? true end |
#typecast(value) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/betty_resource/model/property/types/has_many.rb', line 12 def typecast(value) filter = { 'operator' => 'and', 'conditions' => [ 'path' => [inverse_property.id, model.property(:id).id], 'predicate' => 'eq', 'criteria' => 1 ] } target_model.all :filters => [filter] end |