File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -44,16 +44,19 @@ def debug_requested?
4444
4545 def hash
4646 @hash ||= { } . tap do |h |
47- h [ :filter ] = filters unless filters . empty?
48- h [ :sort ] = sorts unless sorts . empty?
49- h [ :page ] = pagination unless pagination . empty?
50- unless association?
51- h [ :fields ] = fields unless fields . empty?
52- h [ :extra_fields ] = extra_fields unless extra_fields . empty?
47+ h [ :filter ] = filters
48+ h [ :sort ] = sorts
49+ h [ :page ] = pagination
50+ if association?
51+ resource_type = @resource . class . type
52+ h [ :extra_fields ] = { resource_type => extra_fields [ resource_type ] } if extra_fields . key? ( resource_type )
53+ else
54+ h [ :fields ] = fields
55+ h [ :extra_fields ] = extra_fields
5356 end
54- h [ :stats ] = stats unless stats . empty?
55- h [ :include ] = sideload_hash unless sideload_hash . empty?
56- end
57+ h [ :stats ] = stats
58+ h [ :include ] = sideload_hash
59+ end . reject { | _ , value | value . empty? }
5760 end
5861
5962 def zero_results?
Original file line number Diff line number Diff line change 744744 } ,
745745 include : {
746746 positions : {
747+ extra_fields : { positions : [ :baz ] } ,
747748 include : {
748- department : { }
749+ department : {
750+ extra_fields : { departments : [ :bax ] }
751+ }
749752 }
750753 }
751754 }
You can’t perform that action at this time.
0 commit comments