I'm adding support for recurring events to my Rails app.
One of the functions is recurring_event.delete_this_and_following
app/models/recurring_event.rb
16 class RecurringEvent < ApplicationRecord
17 belongs_to :event
32 def delete_this_and_following
33 event.recurring_events.where("start_time >= ?", start_time).destroy_all
34 end
Unfortunately this gives me this error:
(byebug) event.recurring_events.where("start_time >= ?", start_time).size
*** ActiveRecord::StatementInvalid Exception: PG::InFailedSqlTransaction:
ERROR: current transaction is aborted, commands ignored until end
of transaction block
: SELECT COUNT(*) FROM "recurring_events"
WHERE "recurring_events"."event_id" = $1 AND
(start_time >= '2018-10-23 10:42:50.281315')
nil
Has start_date wrong format? start_time.to_s => "2018-10-23 11:24:59 UTC"