-
Notifications
You must be signed in to change notification settings - Fork 69
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
Conversation
👧 👧 |
describe '#save' do | ||
it 'saves the post' do | ||
post = Offer.new(organization: organization, user: user, category: category, title: 'Title') | ||
persister = ::Persister::PostPersister.new(post) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
members
or Member
?
There was a problem hiding this comment.
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, ...
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