method

order!

Importance_0
order!(*args) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/query_methods.rb, line 279
    def order!(*args) # :nodoc:
      args.flatten!
      validate_order_args args

      references = args.reject { |arg| Arel::Node === arg }
      references.map! { |arg| arg =~ /^([a-zA-Z]\w*)\.(\w+)/ && $1 }.compact!
      references!(references) if references.any?

      # if a symbol is given we prepend the quoted table name
      args = args.map! { |arg|
        arg.is_a?(Symbol) ?
          Arel::Nodes::Ascending.new(klass.arel_table[arg]) :
          arg
      }

      self.order_values += args
      self
    end
Register or log in to add new notes.