Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added table name to clear out "ambiguous column name bug" when sortin…

…g joint tables.
  • Loading branch information...
commit b336e60323e1e1f4a5b7f0503e52129f9437cd62 1 parent 1f3526d
Benoit Bénézech authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/rails_admin/adapters/active_record.rb
View
1  lib/rails_admin/adapters/active_record.rb
@@ -144,6 +144,7 @@ def model_store_exists?
def merge_order(options)
@sort ||= options.delete(:sort) || "id"
+ @sort = (@sort.to_s.include?('.') ? @sort : "#{model.table_name}.#{@sort}")
@sort_order ||= options.delete(:sort_reverse) ? "asc" : "desc"
options.merge(:order => "#{@sort} #{@sort_order}")
end
Please sign in to comment.
Something went wrong with that request. Please try again.