mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
114554395-start_date_added
This commit is contained in:
parent
59ed022d8d
commit
ffb76c7372
5 changed files with 34 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
class Admin::EppLogsController < AdminController
|
||||
load_and_authorize_resource class: ApiLog::EppLog
|
||||
before_action :set_default_dates, only: [:index]
|
||||
|
||||
def index
|
||||
@q = ApiLog::EppLog.search(params[:q])
|
||||
|
@ -10,4 +11,13 @@ class Admin::EppLogsController < AdminController
|
|||
def show
|
||||
@epp_log = ApiLog::EppLog.find(params[:id])
|
||||
end
|
||||
|
||||
def set_default_dates
|
||||
params[:q] ||= {}
|
||||
|
||||
if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
|
||||
params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue