instance method <=>

Ruby on Rails 3.2.22.5

Since v3.1.12 Last seen in v3.2.22.5

Available in: v3.1.12 v3.2.22.5

Signature

<=>(other_object)

Allows sort on objects

Parameters

other_object req
Source
# File activerecord/lib/active_record/base.rb, line 618
      def <=>(other_object)
        if other_object.is_a?(self.class)
          self.to_key <=> other_object.to_key
        else
          nil
        end
      end

Defined in activerecord/lib/active_record/base.rb line 618 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Base

Type at least 2 characters to search.

↑↓ navigate · open · esc close