Skip to content

Don't create Profile in ProfileMaker#new#1630

Merged
jmhooper merged 1 commit intomasterfrom
jmhooper-profile-maker-make-profile
Aug 21, 2017
Merged

Don't create Profile in ProfileMaker#new#1630
jmhooper merged 1 commit intomasterfrom
jmhooper-profile-maker-make-profile

Conversation

@jmhooper
Copy link
Contributor

Why: So that a database write does not happen as the side-effect of a service class's initializer.

This is something that has confused me several times while reading the code. I think this helps make things a bit more clear regarding when the profile record is actually created.

I'm also considering a change to make ProfileMaker#make_profile into MakeProfile#call.

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM good catch! one small naming question, not a blocker

Copy link
Contributor

Choose a reason for hiding this comment

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

what if we renamed this to save_profile -- since to me,make sounds more like a #new than a #save!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, will change

@jmhooper jmhooper force-pushed the jmhooper-profile-maker-make-profile branch from b1ebcb1 to b44fccc Compare August 21, 2017 15:24
**Why**: So that a database write does not happen as the side-effect of
a service class's initializer
@jmhooper jmhooper merged commit 70fea7f into master Aug 21, 2017
@jmhooper jmhooper deleted the jmhooper-profile-maker-make-profile branch December 12, 2017 20:15
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.

2 participants