• L
    Build the reverse_order on its proper method. · 6c311e0b
    Lauro Caetano 提交于
    The reverse_order method was using a flag to control if the order should
    be reversed or not. Instead of using this variable just build the reverse order
    inside its proper method.
    
    This implementation was leading to an unexpected behavior when using
    reverse_order and then applying reorder(nil).
    
    Example:
      Before
        Post.order(:name).reverse_order.reorder(nil)
        # => SELECT "posts".* FROM "posts"   ORDER BY "posts"."id" DESC
    
      After
        Post.order(:name).reverse_order.reorder(nil)
       # => SELECT "posts".* FROM "posts"
    6c311e0b
mutation_test.rb 4.5 KB