We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When rendering document with conditional relationship which is not be rendered it is still rendered in included documents.
included
require 'spec_helper' describe JSONAPI::Serializable::Renderer, '#render_relationship' do let(:posts) { [Post.new(id: 1), Post.new(id: 2)] } let(:user) do User.new(id: 'foo', name: 'Lucas', address: '22 Ruby drive', posts: posts) end it 'does not render included conditional relationship' do klass = Class.new(JSONAPI::Serializable::Resource) do extend JSONAPI::Serializable::Resource::ConditionalFields type 'users' has_many :posts, if: -> { false } end hash = subject.render(user, include: [:posts], class: { User: klass, Post: SerializablePost }) expect(hash).not_to have_key(:included) end end
The text was updated successfully, but these errors were encountered:
Thanks for bringing this up @dush.
Sorry, something went wrong.
No branches or pull requests
When rendering document with conditional relationship which is not be rendered it is still rendered in
included
documents.The text was updated successfully, but these errors were encountered: