JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Not able to call any callbackmethod on resource file
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.3k
- Forks
- 546
- PR merge metrics
- No merged PRs in 30d
Description
I am not able to call any callback method on resource file, following code is not working for me. I have tried for my resource file.
class PeopleResource < JSONAPI::Resource
before_save do
@model.user_id = context[:current_user].id if @model.new_record?
end
end
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report provides only a PeopleResource snippet and no file path, failing test, or expected callback behavior. Start by reproducing the before_save example with JSONAPI::Resource, then trace the callback entry point; done means the callback behavior is verified and covered by a regression test or the issue is narrowed to a documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100