In readme.md there's a code sample for using fetchable fields:
class AuthorResource < JSONAPI::Resource
attributes :name, :email
model_name 'Person'
has_many :posts
def fetchable_fields
if (context.current_user.guest)
super(context) - [:email]
else
super(context)
end
end
end
When I tried to implement this, I got an error that super doesn't take any arguments. Removing (context) made the code work as expected. Is this a doc bug or a bug in the fetchable_fields implementation? I'm using JSONAPI::ActsAsResourceController, if that has anything to do with it.
In readme.md there's a code sample for using fetchable fields:
When I tried to implement this, I got an error that super doesn't take any arguments. Removing
(context)made the code work as expected. Is this a doc bug or a bug in the fetchable_fields implementation? I'm usingJSONAPI::ActsAsResourceController, if that has anything to do with it.