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

Extract services from comments controller #6307

Closed

Conversation

KentShikama
Copy link
Contributor

For the comments API routes

@text = params[:text]
end

def create_comment!
Copy link
Member

Choose a reason for hiding this comment

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

I tend to prefer Ruby core's naming convention of not having a bang! method if there's no nonbang variant.

@jhass
Copy link
Member

jhass commented Aug 9, 2015

For Post you did one that service that does both, creation and destruction. Having separate ones for Comment now feels a bit inconsistent to me.

@KentShikama
Copy link
Contributor Author

For posts I put the show and destroy together in one service and the create in another service. I suppose I should just separate the show and destroy service for the posts?

@jhass
Copy link
Member

jhass commented Aug 9, 2015

I think I wouldn't mind a service per model. Currently we have about what, a dozen resources? With two to four of the CRUD actions that's 30-40 services.

@KentShikama
Copy link
Contributor Author

Yeah sounds good; I'll merge them together then 👍

@jhass
Copy link
Member

jhass commented Aug 9, 2015

Merged as d7c9243

Thanks!

@jhass jhass added this to the 0.5.3.0 milestone Aug 9, 2015
@KentShikama KentShikama deleted the refactor-comments-controller branch September 13, 2015 22:11
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.

None yet

2 participants