Method: JSONAPI::Resource#records_for
- Defined in:
- lib/jsonapi/resource.rb
#records_for(relation_name) ⇒ Object
Override this on a resource to customize how the associated records are fetched for a model. Particularly helpful for authorization.
119 120 121 |
# File 'lib/jsonapi/resource.rb', line 119 def records_for(relation_name) _model.public_send relation_name end |