diff --git a/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb b/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb
index <HASH>..<HASH> 100644
--- a/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb
+++ b/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb
@@ -16,7 +16,7 @@ module RailsEventStoreActiveRecord
           expected_version
       end
       in_stream = events.flat_map.with_index do |event, index|
-        position = if expected_version == :any
+        position = if expected_version.equal?(:any)
           nil
         else
           expected_version + index + 1
More strong check

I am not sure if `equal` will always work, but I think it will as two
identical symbols must be the same object, no matter how constructed.