Skip to content

Commit

Permalink
Small fix in Refactoring of AdvancedSearchController
Browse files Browse the repository at this point in the history
  • Loading branch information
Subhas Dandapani authored and Subhas Dandapani committed Dec 15, 2013
1 parent 009b70b commit 80100d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/advanced_search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ def add_updated_by_filter params

def add_created_at_filter params
@criteria_list.push(SearchDateFilter.new({:field => "created_at",
:from_value => (params[:created_at_after_value].present? ? "*" : "#{params[:created_at_after_value]}T00:00:00Z"),
:to_value => (params[:created_at_before_value].present? ? "*" : "#{params[:created_at_before_value]}T00:00:00Z"),
:from_value => (params[:created_at_after_value].blank? ? "*" : "#{params[:created_at_after_value]}T00:00:00Z"),
:to_value => (params[:created_at_before_value].blank? ? "*" : "#{params[:created_at_before_value]}T00:00:00Z"),
:index => 1,
:join => "AND"})) if (params[:created_at_after_value].present? || params[:created_at_before_value].present?)
end

def add_updated_at_filter params
@criteria_list.push(SearchDateFilter.new({:field => "last_updated_at",
:from_value => (params[:updated_at_after_value].present? ? "*" : "#{params[:updated_at_after_value]}T00:00:00Z"),
:to_value => (params[:updated_at_before_value].present? ? "*" : "#{params[:updated_at_before_value]}T00:00:00Z"),
:from_value => (params[:updated_at_after_value].blank? ? "*" : "#{params[:updated_at_after_value]}T00:00:00Z"),
:to_value => (params[:updated_at_before_value].blank? ? "*" : "#{params[:updated_at_before_value]}T00:00:00Z"),
:index => 2,
:join => "AND"})) if (params[:updated_at_after_value].present? || params[:updated_at_before_value].present?)
end
Expand Down

0 comments on commit 80100d7

Please sign in to comment.