How about a ternary?

``` ruby
self.primary_key = self == base_class ? get_primary_key(base_class.name) : base_class.primary_key
```

I see the point about not polluting the git history, though, as it has no real world benefit. ;)