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

rename context to serialization_context #1313

Merged
merged 1 commit into from
Nov 7, 2015

Conversation

tchak
Copy link
Contributor

@tchak tchak commented Oct 31, 2015

A resubmit of my earlier PR. Removed all references to url_helpers for now. See #1289 (comment) for reference

cc @bf4

@NullVoxPopuli
Copy link
Contributor

LGTM 👍

@@ -0,0 +1,12 @@
module ActionController
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure the Context class belongs in ActionController, as we might want to use it for non-AC related stuff as well. Some mixin/concern definitely belongs here, but I think the base Context class should be part of the ActiveModel(::)Serializer(s) namespace. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree - action controller isn't ever going to really make use of the context, where as it is AMS that utilizes context.

Copy link
Contributor

Choose a reason for hiding this comment

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

The action controller only creates the context, and that's it

Copy link
Member

Choose a reason for hiding this comment

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

It's not in action_controller, it's namespaced within actioncontroller::serialization which is fine by me

Copy link
Member

Choose a reason for hiding this comment

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

Alternative: lib/active_model_serializers/serialization_context.rb

module ActiveModelSerializers
  class SerializationContext
    #etc
  end
end

Copy link
Member

Choose a reason for hiding this comment

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

speaking for myself, I would mere that in the next 10 minutes

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, let's put it in active_model_serializers/serialization_context and I'm OK to merge.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

@tchak amend commit, force push, and we'll merge

Copy link
Member

Choose a reason for hiding this comment

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

@tchak want one of us to do it?

@tchak tchak force-pushed the serialization_context branch from c0c4af8 to 31172b1 Compare November 7, 2015 19:32
@tchak
Copy link
Contributor Author

tchak commented Nov 7, 2015

@bf4 fixed and rebased. Sorry for the delay!

@NullVoxPopuli
Copy link
Contributor

Looks good to me. We are still in disarray about namespacing, but that's outside the scope of this.

good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants