Remove dead branch when restoring ID within a transaction

There is no way to have an instance of an Active Record model where
`has_attribute?(self.class.primary_key)` returns false. The record is
always initialized in such a way that `@raw_attributes` will have an id
key with nil for the value.

Reduces the number of places outside of attribute methods which care
about the internals of how we store and type cast attributes.
The restore_state always sets the key :id.
On Jun 7, 2014 10:50 AM, "Kuldeep Aggarwal" <notifications@github.com>
wrote:

> In activerecord/lib/active_record/transactions.rb:
>
> > @@ -371,12 +371,7 @@ def restore_transaction_record_state(force = false) #:nodoc:
> >            @raw_attributes = @raw_attributes.dup if @raw_attributes.frozen?
> >            @new_record = restore_state[:new_record]
> >            @destroyed  = restore_state[:destroyed]
> > -          if restore_state.has_key?(:id)
>
> here we are checking with :id not with primary_key, so is this correct to
> remove this?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/rails/rails/pull/15564/files#r13520270>.
>