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

Feature: ActiveJob Integration and Documentation #817

Merged
merged 7 commits into from
Sep 11, 2017

Conversation

codebycliff
Copy link
Collaborator

Description

This pull request makes it so that decorators implement GlobalID so they can be passed to background jobs. While you can now pass a decorated object to a background job, it won't be decorated when it is deserialized. This may lead to some confusion, so it is documented in the README.

Testing

Try to pass a decorated object to a background job and it should no longer throw ActiveJob::SerializationError.

To-Dos

  • tests
  • documentation

References

@codebycliff
Copy link
Collaborator Author

@syguer I don't know if you are still interested in helping, but if you are, I'd appreciate a look at this when you get a chance.

@syguer
Copy link
Contributor

syguer commented Aug 2, 2017

sure 😄
Please give me some time, I'll look.

@syguer
Copy link
Contributor

syguer commented Aug 3, 2017

@codebycliff Sorry for late. Looks good! 😄
In addition, It might be good to add some spec for to_global_id like this

let(:post) { Post.create }
let(:decorated_post) { post.decorate }
subject { decorated_post.to_global_id }

it { is_expected.to eq post.to_global_id }

This might be exaggerate spec. I respect your decision 👍

@syguer
Copy link
Contributor

syguer commented Sep 11, 2017

Thanks!
LGTM 👍

@codebycliff codebycliff merged commit 815c418 into master Sep 11, 2017
@codebycliff codebycliff deleted the feature/active-job-integration branch September 11, 2017 16:35
Alexander-Senko added a commit to Alexander-Senko/draper that referenced this pull request Feb 6, 2024
Implementing `Decorator.find` improves compatibility with Global ID and
allows one to use decorated objects in jobs seamlessly.

Improves drapergem#817.
Alexander-Senko added a commit to Alexander-Senko/draper that referenced this pull request Feb 6, 2024
Implementing `Decorator.find` improves compatibility with Global ID and
allows one to use decorated objects in jobs seamlessly.

Resolves drapergem#663.
Improves drapergem#817.
Alexander-Senko added a commit to Alexander-Senko/draper that referenced this pull request Aug 30, 2024
Implementing `Decorator.find` improves compatibility with Global ID and
allows one to use decorated objects in jobs seamlessly.

Resolves drapergem#663.
Improves drapergem#817.
Alexander-Senko added a commit to Alexander-Senko/draper that referenced this pull request Sep 1, 2024
Implementing `Decorator.find` improves compatibility with Global ID and
allows one to use decorated objects in jobs seamlessly.

Resolves drapergem#663.
Improves drapergem#817.
Alexander-Senko added a commit that referenced this pull request Sep 1, 2024
Implementing `Decorator.find` improves compatibility with Global ID and
allows one to use decorated objects in jobs seamlessly.

Resolves #663.
Improves #817.
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