I guess you actually meant to say that Emacs aligns the if
with the end
, which is actually pretty idiomatic in Ruby (and the style enforced by tools like RuboCop). The second indentation style is popular for method class with blocks, but not for expressions like if/unless/case
.
Currently there is now way to change this behaviour. There are plans to introduce a more flexible indentation scheme in ruby-mode in the future, but that's not going to happen in the next Emacs release.
At any rate - it's not a bug, it's a feature :-)