Skip to content

Introducing Persisters #347

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

Merged
merged 3 commits into from
May 2, 2018
Merged

Conversation

mllocs
Copy link
Collaborator

@mllocs mllocs commented May 1, 2018

First step on creating resources as side effects. In the future, when creating/updating a Post/Member/Transfer, it will create Events as side effects. Events will be used to create a kind of "Activity thread" section in a Time Bank.

About the naming: https://english.stackexchange.com/questions/206893/persister-or-persistor

@mllocs mllocs requested review from enricostano and sauloperez May 1, 2018 09:00
@mllocs
Copy link
Collaborator Author

mllocs commented May 1, 2018

👧 👧

describe '#save' do
it 'saves the post' do
post = Offer.new(organization: organization, user: user, category: category, title: 'Title')
persister = ::Persister::PostPersister.new(post)
Copy link
Contributor

Choose a reason for hiding this comment

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

Move both to let and reuse in examples


describe '#update_attributes' do
it 'updates the attributes' do
persister = ::Persister::PostPersister.new(post)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

end
return unless organization

member = members.where(organization: organization).first_or_initialize
Copy link
Contributor

Choose a reason for hiding this comment

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

members or Member?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

members would be the same as doing Member.where(user: self, ...

@mllocs mllocs mentioned this pull request May 1, 2018
@sauloperez sauloperez merged commit e9eb717 into develop May 2, 2018
@enricostano enricostano mentioned this pull request Aug 8, 2018
@markets markets deleted the feature/introducing-post-persister branch February 16, 2019 13:18
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.

3 participants