app/queries/proposal_search_dsl.rb
Class ProposalSearchDsl
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ProposalSearchDsl
include Elasticsearch::DSL
attr_reader :params, :current_user, :query_str, :client_data_type
Use the return of the conditional for variable assignment and comparison. Open
Open
if relative_to_now
fielded[:created_at] = "[#{ranges[0].iso8601} TO now]"
else
fielded[:created_at] = "[#{ranges[0].iso8601} TO #{ranges[1].utc.iso8601}]"
end
- Exclude checks
Use the return of the conditional for variable assignment and comparison. Open
Open
if @from
@dsl.from = @from
elsif params[:from]
@dsl.from = params[:from].to_i
else
- Exclude checks
Use the return of the conditional for variable assignment and comparison. Open
Open
if params[:size] == :all
@dsl.size = Proposal::MAX_DOWNLOAD_ROWS
elsif @size
@dsl.size = @size
elsif params[:size]
- Exclude checks