diff --git a/app/controllers/audits1984/filtered_sessions_controller.rb b/app/controllers/audits1984/filtered_sessions_controller.rb index 37ce052..abb51e7 100644 --- a/app/controllers/audits1984/filtered_sessions_controller.rb +++ b/app/controllers/audits1984/filtered_sessions_controller.rb @@ -9,7 +9,7 @@ def update private def filtered_sessions_param - params.require(:filtered_sessions).permit(:sensitive_only, :from_date, :to_date) + params.require(:filtered_sessions).permit(:sensitive_only, :from_date, :to_date, :pending_only) end end end diff --git a/app/models/audits1984/filtered_sessions.rb b/app/models/audits1984/filtered_sessions.rb index f3cebb7..46fd1f7 100644 --- a/app/models/audits1984/filtered_sessions.rb +++ b/app/models/audits1984/filtered_sessions.rb @@ -6,6 +6,7 @@ class FilteredSessions attribute :from_date, :date attribute :to_date, :date attribute :sensitive_only, :boolean + attribute :pending_only, :boolean def self.resume(attributes) new attributes&.with_indifferent_access&.slice(*attribute_names) @@ -18,6 +19,7 @@ def to_h def all sessions = Console1984::Session.order(created_at: :desc, id: :desc) sessions = sessions.sensitive if sensitive_only + sessions = sessions.pending if pending_only sessions = sessions.where("console1984_sessions.created_at >= ?", from_date.beginning_of_day) if from_date.present? sessions = sessions.where("console1984_sessions.created_at <= ?", to_date.end_of_day) if to_date.present? sessions diff --git a/app/views/audits1984/sessions/_filter.html.erb b/app/views/audits1984/sessions/_filter.html.erb index 945d9c6..a339885 100644 --- a/app/views/audits1984/sessions/_filter.html.erb +++ b/app/views/audits1984/sessions/_filter.html.erb @@ -17,11 +17,16 @@ -