Skip to content
New issue

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

Extract IncludeTree. #1685

Merged
merged 1 commit into from
May 28, 2016

Conversation

beauby
Copy link
Contributor

@beauby beauby commented Apr 16, 2016

Purpose

Extract the IncludeTree class (new source) into its own gem (jsonapi, in an attempt to share some work with jsonapi-resources (c.f. cerebris/jsonapi-resources#679).

Changes

Caveats

Related GitHub issues

Additional helpful information

@NullVoxPopuli
Copy link
Contributor

doh, now it needs rebase :-(

@beauby
Copy link
Contributor Author

beauby commented Apr 18, 2016

No worries, should be an easy one. Plus, let's wait for the gem renaming.

@NullVoxPopuli
Copy link
Contributor

Removing 'Needs Team Discussion' because we already discussed what to do with this.
To kinda summarize:

  • rename the gem to help out with cliry (pending mr. minecraft gives permission / frees up the jsonapi gem namespace)

@@ -33,7 +36,7 @@ def serializable_hash_for_single_resource(options)

def resource_relationships(options)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR but this method could be rewritten as follows:

def resource_relationships(options)
  serializer.associations(@include_directive)
            .each_with_object({}) do |association, hash|
    hash[association.key] = relationship_value_for(association, options)
  end
end

@beauby
Copy link
Contributor Author

beauby commented May 16, 2016

Rebased and changed the gem's name to jsonapi as well as the namespace to JSONAPI.

@@ -42,6 +42,8 @@ Gem::Specification.new do |spec|
# 'minitest'
# 'thread_safe'

spec.add_runtime_dependency 'jsonapi'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented May 16, 2016

LGTM, just two more things before merging:

  • document the new option in the docs (include_directive)
  • Changelog Entry

@bf4
Copy link
Member

bf4 commented May 16, 2016

Yay! though I don't think the jsonapi gem should be implementing the * since that's not part of the spec and makes valid params checking a bit weird :)

@beauby
Copy link
Contributor Author

beauby commented May 16, 2016

@bf4 The default behavior of the gem is to ignore *. One can enable it via the "experimental option" allow_wildcards. Moreover, there is talk about adding some kind of wildcard in the spec. I mainly added it not to break backwards compatibility in AMS, but I'm totally open to discussing removing it.

@bf4
Copy link
Member

bf4 commented May 16, 2016

Awesome response!

B mobile phone

On May 16, 2016, at 2:56 PM, Lucas Hosseini [email protected] wrote:

@bf4 The default behavior of the gem is to ignore *. One can enable it via the "experimental option" allow_wildcards. Moreover, there is talk about adding some kind of wildcard in the spec. I mainly added it not to break backwards compatibility in AMS, but I'm totally open to discussing removing it.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@NullVoxPopuli
Copy link
Contributor

needs rebase :-(

@beauby beauby force-pushed the extract-include-directive branch 2 times, most recently from a37abe5 to b75db86 Compare May 18, 2016 08:57
@beauby
Copy link
Contributor Author

beauby commented May 18, 2016

Rebased and changelog added!

@beauby beauby force-pushed the extract-include-directive branch 2 times, most recently from 0e81831 to 73716f8 Compare May 19, 2016 11:11
@beauby
Copy link
Contributor Author

beauby commented May 19, 2016

Rebased again. We should probably pin the dependency to jsonapi though, as it is in beta.

@NullVoxPopuli
Copy link
Contributor

@beauby one last rebase!?

@beauby beauby force-pushed the extract-include-directive branch 2 times, most recently from 32facf0 to f8554e3 Compare May 27, 2016 10:27
@beauby beauby force-pushed the extract-include-directive branch from f8554e3 to 6035c9d Compare May 28, 2016 13:53
@beauby
Copy link
Contributor Author

beauby commented May 28, 2016

Rebased 👍

@NullVoxPopuli
Copy link
Contributor

LGTM! good work @beauby. Your JSON API gem is great! :-)

@NullVoxPopuli NullVoxPopuli merged commit f48fd2a into rails-api:master May 28, 2016
bf4 added a commit to bf4/active_model_serializers that referenced this pull request May 31, 2016
bf4 added a commit that referenced this pull request May 31, 2016
Remove IncludeTree; missing from #1685
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants