rails-sqlserver / activerecord-sqlserver-adapter

SQL Server Adapter For Rails
MIT License
972 stars 559 forks source link

Fix auto populated ID after insert #1077

Closed aidanharan closed 1 year ago

aidanharan commented 1 year ago

Fix issue with auto-population of ActiveRecord object ID after creation by insert.

Example of fixed test is following from https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/5868251547/job/15910651869

InheritanceTest#test_class_with_blank_sti_name:
ActiveRecord::RecordNotFound: Couldn't find Company without an ID
    rails (3779b5069dd1) activerecord/lib/active_record/relation/finder_methods.rb:474:in `find_with_ids'
    rails (3779b5069dd1) activerecord/lib/active_record/relation/finder_methods.rb:69:in `find'
    rails (3779b5069dd1) activerecord/lib/active_record/querying.rb:23:in `find'
    rails (3779b5069dd1) activerecord/lib/active_record/core.rb:250:in `find'
    rails (3779b5069dd1) activerecord/test/cases/inheritance_test.rb:50:in `test_class_with_blank_sti_name'

Ref: