File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
spec/dummy/app/controllers/admin Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 55module AdministrateRansack
66 module Searchable
77 def scoped_resource
8- options = respond_to? ( :ransack_options ) ? ransack_options : { }
8+ options = respond_to? ( :ransack_options , true ) ? ransack_options : { }
9+ distinct = respond_to? ( :ransack_result_distinct , true ) ? ransack_result_distinct : true
910 @ransack_results = super . ransack ( params [ :q ] , **options )
10- @ransack_results . result ( distinct : true )
11+ @ransack_results . result ( distinct : distinct )
1112 end
1213
1314 # ref => https://github.com/thoughtbot/administrate/blob/v0.18.0/app/helpers/administrate/application_helper.rb#L72-L78
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ def ransack_options
66 { ignore_unknown_conditions : false }
77 end
88
9+ def ransack_result_distinct
10+ false
11+ end
12+
913 # Overwrite any of the RESTful controller actions to implement custom behavior
1014 # For example, you may want to send an email after a foo is updated.
1115 #
You can’t perform that action at this time.
0 commit comments