Some plugins hook into Post after save to set custom fields and save again.
Problem is that in case like that
raw_changed? is false but all callback are triggered.
extracted_polls is class attribute therefore that should be reset with each attempt.
That was causing an error:
#<ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_polls_on_post_id_and_name" DETAIL: Key (post_id, name)=(8967, poll) already exists.