Hello Before rails-7.1.0 i could set alias_attribute field as primary_key, for example:
> class A < ApplicationRecord
> alias_attribute :connection_id, :id
> end
> class B < ApplicationRecord
> alias_attribute :connection_id, :other_id
> end
> class C < ApplicationRecord
> belongs_to :origin, primary_key: :connection_id, polymorphic: true
> end
and it still works if you get single record, like C.first.origin will work correct, but if i’m making C.all.includes(:origin).map {|obj| obj.origin } => [nil] - it wouldn’t load. And it can’t set object via C.first.origin = B.first
is it bug or feature?