When working with other people in a project, is it acceptable to refactor some of their code?
I'm working with another developer and I notice a lot of duplicate code. To make things easier for myself, I will locate the duplicate logic or notice a similar pattern that can be used. I will then put the repeated code in a loop, DRYING up the code.
I work with Rails, so DRY is an important principle. I will also make trivial edits on the code. For example, I would change things like
unless @user.nil?
to
if @user
I'm working on the project as well, and I find repeated blocks of code really annoying, so I take the lead to refactor his code. Is this acceptable?