Plots2: Move comment_render_body helper into Comment model

Created on 1 Oct 2018  ·  4Comments  ·  Source: publiclab/plots2

This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself!


https://github.com/publiclab/plots2/blob/6595ef39f25ca4f2d377cacfd92e86a7460214d6/app/helpers/application_helper.rb#L100-L107

Let's make this a method of Comment - in https://github.com/publiclab/plots2/blob/master/app/models/comment.rb - like:

def render_body

end

And remove it from application_helper.rb!

We'll also need to change this line:

https://github.com/publiclab/plots2/blob/6595ef39f25ca4f2d377cacfd92e86a7460214d6/app/views/notes/_comment.html.erb#L120

To comment.render_body

Finally, the sanitize comment body test in https://github.com/publiclab/plots2/blob/master/test/unit/comment_test.rb could be updated to test comment.render_body instead of reproducing the code from the helper.

Glad to help with this one! Could be a first-timers issue!

Ruby fto-candidate help wanted refactorization

Most helpful comment

I would like to take on this issue, it would be one of my first open source contributions. Also is there anything I would need to know before opening a pull request, like a special schema for commit messages?

All 4 comments

I would like to take on this issue, it would be one of my first open source contributions. Also is there anything I would need to know before opening a pull request, like a special schema for commit messages?

Nope, there's a template in the pull request form, but it's always editable later, so we can help you out as you go! Welcome! 👍 🎉

@jywarren Thank you! Also those first timer issues are great to get to know the codebase, as I often don't have much time to read into large codebases. 👍

so glad you like them!!!

On Mon, Oct 1, 2018 at 6:09 PM Maurice T. Meyer notifications@github.com
wrote:

@jywarren https://github.com/jywarren Thank you! Also those first timer
issues are great to get to know the codebase, as I often don't have much
time to read into large codebases. 👍


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/3552#issuecomment-426080866,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ7XhfzVY7CxWNvf58mMmOiKBNZjlks5ugpKSgaJpZM4XCx6-
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

milaaraujo picture milaaraujo  ·  3Comments

grvsachdeva picture grvsachdeva  ·  3Comments

keshavsethi picture keshavsethi  ·  3Comments

bronwen9 picture bronwen9  ·  3Comments

first-timers[bot] picture first-timers[bot]  ·  3Comments