Skip to content
  • Neeraj Singh's avatar
    1c7a7545
    order should always be concatenated. · 1c7a7545
    Neeraj Singh authored
    
    
    order that is declared first has highest priority in all cases.
    
    Here are some examples.
    
    Car.order('name desc').find(:first, :order => 'id').name
    
    Car.named_scope_with_order.named_scope_with_another_order
    
    Car.order('id DESC').scoping do
      Car.find(:first, :order => 'id asc')
    end
    
    No special treatment to with_scope or scoping.
    
    Also note that if default_scope declares an order then the order
    declared in default_scope has the highest priority unless
    with_exclusive_scope is used.
    
    Signed-off-by: default avatarSantiago Pastorino <santiago@wyeworks.com>
    1c7a7545
    order should always be concatenated.
    Neeraj Singh authored
    
    
    order that is declared first has highest priority in all cases.
    
    Here are some examples.
    
    Car.order('name desc').find(:first, :order => 'id').name
    
    Car.named_scope_with_order.named_scope_with_another_order
    
    Car.order('id DESC').scoping do
      Car.find(:first, :order => 'id asc')
    end
    
    No special treatment to with_scope or scoping.
    
    Also note that if default_scope declares an order then the order
    declared in default_scope has the highest priority unless
    with_exclusive_scope is used.
    
    Signed-off-by: default avatarSantiago Pastorino <santiago@wyeworks.com>
Loading