{"record":{"id":"c953091f8e5241f4","repo":"railsadminteam/rails_admin","slug":"the-sort-reverse-configuration-option-is-deprecate","errorCode":null,"errorMessage":"The sort_reverse configuration option is deprecated and has no effect.","messagePattern":"The sort_reverse configuration option is deprecated and has no effect\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/rails_admin/config/sections/list.rb","lineNumber":58,"sourceCode":"\n        register_instance_option :scopes do\n          []\n        end\n\n        register_instance_option :row_css_class do\n          ''\n        end\n\n        register_deprecated_instance_option :sidescroll do\n          ActiveSupport::Deprecation.warn('The sidescroll configuration option was removed, it is always enabled now.')\n        end\n\n        def fields_for_table\n          visible_fields.partition(&:sticky?).flatten\n        end\n\n        register_deprecated_instance_option :sort_reverse do\n          ActiveSupport::Deprecation.warn('The sort_reverse configuration option is deprecated and has no effect.')\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":40,"sourceCodeEnd":64,"githubUrl":"https://github.com/railsadminteam/rails_admin/blob/0690a5e62f8d99bc00495a3754f5189b23124387/lib/rails_admin/config/sections/list.rb#L40-L64","documentation":"The list-section sort_reverse option (lib/rails_admin/config/sections/list.rb:57) used to flip the default sort direction of a model's list. In current RailsAdmin it is a deprecated stub that only prints this ActiveSupport::Deprecation warning; direction is instead derived from the sort_reverse URL parameter (MainController#get_sort_hash, app/controllers/rails_admin/main_controller.rb:78-79) combined with the per-field sort_reverse? option (lib/rails_admin/config/fields/base.rb:112, defaulting true for datetime/integer/bson_object_id fields so timestamps sort newest-first).","triggerScenarios":"A model config containing `list { sort_reverse true }` (or false). The warning fires when the model config loads, and the passed value has zero effect — the list sorts per the field's sort_reverse? default and the user's header-click toggles, exactly as if the line were absent.","commonSituations":"Old 2.x-era configs setting sort_reverse expecting oldest-first (or newest-first) listings that silently stopped working after upgrade; teams debugging 'my default sort direction changed after the rails_admin bump' while the leftover option still warns; spec suites with deprecations raised as errors.","solutions":["Delete the `sort_reverse` line from the list block — it does nothing.","If you need a specific default direction, set it on the field instead: `field :created_at, :datetime do sort_reverse? false end` (per-field, still honored by get_sort_hash).","If you need full control of the initial ordering, set `list { sort_by :my_column }` and let users toggle direction via the column headers (params[:sort_reverse])."],"exampleFix":"# before (warns, no effect)\nRailsAdmin.config do |config|\n  config.model Post do\n    list do\n      sort_by :created_at\n      sort_reverse false\n    end\n  end\nend\n\n# after: direction set per field via sort_reverse?\nRailsAdmin.config do |config|\n  config.model Post do\n    list { sort_by :created_at }\n    field :created_at, :datetime do\n      sort_reverse? false # oldest first\n    end\n  end\nend","handlingStrategy":"validation","validationCode":"# Assert list config uses only live options and that direction is field-driven\nRSpec.configure do |c|\n  c.before { ActiveSupport::Deprecation.silenced = false }\nend\n# spec: expects no deprecation when loading the model's list section\nexpect { RailsAdmin.config(Player).list }.not_to output(/deprecated/).to_stdout_from_any_process","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Express default sort direction per field with sort_reverse? (fields/base.rb:112), not on the list section.","Write a request spec per model asserting the index's default ordering (first record), so a silently-ignored sort option is caught as a behavior change.","Run the suite with ActiveSupport::Deprecation.behavior = :raise so any deprecated option usage — including sort_reverse — turns into a test failure."],"tags":["rails-admin","deprecation","sorting","configuration","ruby","list-view"],"backgroundTag":"deprecated-config-option","analyzedSha":"0690a5e62f8d99bc00495a3754f5189b23124387","analyzedAt":"2026-08-21T18:31:19.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}