instance method
<=>
Ruby on Rails 3.2.22.5
Since v3.1.12 Last seen in v3.2.22.5Available in: v3.1.12 v3.2.22.5
Signature
<=>(other_object)
Allows sort on objects
Parameters
-
other_objectreq
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