class

Array

v7.1.3.4 - Show latest stable - Superclass: Object

frozen_string_literal: true


frozen_string_literal: true


frozen_string_literal: true


frozen_string_literal: true

Files

  • activesupport/lib/active_support/core_ext/array/access.rb
  • activesupport/lib/active_support/core_ext/array/conversions.rb
  • activesupport/lib/active_support/core_ext/array/extract.rb
  • activesupport/lib/active_support/core_ext/array/extract_options.rb
  • activesupport/lib/active_support/core_ext/array/grouping.rb
  • activesupport/lib/active_support/core_ext/array/inquiry.rb
  • activesupport/lib/active_support/core_ext/array/wrap.rb
  • activesupport/lib/active_support/core_ext/enumerable.rb
  • activesupport/lib/active_support/core_ext/object/blank.rb
  • activesupport/lib/active_support/core_ext/object/deep_dup.rb
  • activesupport/lib/active_support/core_ext/object/json.rb
  • activesupport/lib/active_support/core_ext/object/to_query.rb

1Note

sort_by

Ramon ยท Oct 3, 2009

array.sort_by {|element| [element.foo, element.bar.name, element.baz]}

Taken from http://redcorundum.blogspot.com/2006/10/using-sortby-instead-of-sort.html