Class: RailsPerformance::Rails::QueryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_performance/rails/query_builder.rb

Class Method Summary collapse

Class Method Details

.compose_from(params) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rails_performance/rails/query_builder.rb', line 5

def QueryBuilder.compose_from(params)
  result = {}

  result[:controller] = params[:controller_eq]
  result[:action]     = params[:action_eq]
  result[:format]     = params[:format_eq]
  result[:status]     = params[:status_eq]

  result.delete_if {|k, v| v.nil?}

  { q: result }
end