Class: Cable::PurgesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Cable::PurgesController
- Defined in:
- app/controllers/solid_stack_web/cable/purges_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
3 4 5 6 7 |
# File 'app/controllers/solid_stack_web/cable/purges_controller.rb', line 3 def destroy days = [params[:older_than].to_i, 1].max ::SolidCable::Message.where("created_at < ?", days.days.ago).delete_all redirect_to cable_path, notice: "Messages older than #{days} #{days == 1 ? "day" : "days"} purged." end |