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

Refactor fragment cache methods #1527

Closed
wants to merge 1 commit into from

Conversation

groyoh
Copy link
Member

@groyoh groyoh commented Feb 19, 2016

Removed extra calls to constantize and DRY'd the code.

@groyoh groyoh force-pushed the refactor_fragment_cache branch 2 times, most recently from 3f9d26c to fac4521 Compare February 19, 2016 18:44
@@ -23,7 +23,8 @@ Fixes:
- [#1501](https://github.com/rails-api/active_model_serializers/pull/1501) Adds tests for SerializableResource::use_adapter?,doc typos (@domitian)
- [#1488](https://github.com/rails-api/active_model_serializers/pull/1488) Require ActiveSupport's string inflections (@nate00)

Misc:
Misc
Copy link
Member

Choose a reason for hiding this comment

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

accidental : removal

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah true!

@bf4
Copy link
Member

bf4 commented Feb 19, 2016

Looks awesome!

@groyoh groyoh force-pushed the refactor_fragment_cache branch from fac4521 to 8276f0a Compare February 19, 2016 23:14
def cached_attributes(klass, serializers)
attributes = serializer.class._attributes
cached_attributes = (klass._cache_only) ? klass._cache_only : attributes.reject { |attr| klass._cache_except.include?(attr) }
def cached_attributes(serializers)
Copy link
Member

Choose a reason for hiding this comment

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

looks like this method should really be called cache_attributes as it is neither idempotent nor does it is a Query; rather it is a Command

Copy link
Member

Choose a reason for hiding this comment

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

and I suppose these are really something like fragmented_serializers

Copy link
Member Author

Choose a reason for hiding this comment

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

Completely agree on this. 👍

@NullVoxPopuli
Copy link
Contributor

needs rebase :-)

@groyoh groyoh force-pushed the refactor_fragment_cache branch from 8276f0a to 05a5b87 Compare March 8, 2016 22:11
@groyoh
Copy link
Member Author

groyoh commented Mar 8, 2016

Rebased it and changed the methods to be more descriptive. @bf4 I'll work on rebasing #1471 once this gets merged if that's fine with you.

@bf4
Copy link
Member

bf4 commented Mar 8, 2016

This branch has conflicts that must be resolved

:)

@groyoh
Copy link
Member Author

groyoh commented Mar 8, 2016

Damn, I'm conflicting with myself now 😄

@groyoh groyoh force-pushed the refactor_fragment_cache branch from 05a5b87 to 20a2cf3 Compare March 8, 2016 22:36
@groyoh
Copy link
Member Author

groyoh commented Mar 8, 2016

Rebased again :)

@groyoh groyoh force-pushed the refactor_fragment_cache branch from 20a2cf3 to fcdbaa5 Compare March 8, 2016 22:38
Removed extra calls to constantize and DRY'd the code.
@groyoh groyoh force-pushed the refactor_fragment_cache branch from fcdbaa5 to 580139f Compare March 8, 2016 22:38
@groyoh
Copy link
Member Author

groyoh commented Mar 8, 2016

Damn I messed up with this one, will reopen when I fix it.

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.

3 participants