mirror of
https://github.com/internetee/registry.git
synced 2025-06-03 11:17:30 +02:00
Fix domain_history filtration
This commit is contained in:
parent
5cb6b0ae1e
commit
1944e462c3
1 changed files with 12 additions and 1 deletions
|
@ -44,7 +44,7 @@ module Admin
|
|||
where_s += ' AND 1=0' if registrars == []
|
||||
|
||||
versions = Version::DomainVersion.includes(:item).where(where_s).order(created_at: :desc, id: :desc)
|
||||
@q = versions.ransack(params[:q])
|
||||
@q = versions.ransack(fix_date_params)
|
||||
|
||||
@versions = @q.result.page(params[:page])
|
||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
@ -77,5 +77,16 @@ module Admin
|
|||
def create_where_string(key, value)
|
||||
" AND object->>'#{key}' ~* '#{value}'"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def fix_date_params
|
||||
params_copy = params[:q].deep_dup
|
||||
if params_copy['created_at_lteq'].present?
|
||||
params_copy['created_at_lteq'] = Date.parse(params_copy['created_at_lteq']) + 1.day
|
||||
end
|
||||
|
||||
params_copy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue