PMACS / scenic_oracle_enhanced_adapter

OracleEnhanced adapter for Scenic gem.
MIT License
5 stars 2 forks source link

WIP: Add Primary Key migration helper #17

Closed walterdavis closed 5 years ago

walterdavis commented 5 years ago

Views can have primary keys (in Oracle, at least) and Rails will happily work with them so you don't need to add self.primary_key = :non_traditional_key_name to your models.

Adding this method here is a convenience and kind of a hack. If I could think of a way to inject the method from another gem, so it could be PMACS-only, I would feel better about it. I don't want this addition to torpedo our chances of the adapter being merged into the upstream project.

Another question for reviewers: I've used named keys in this method, but everything else uses positional keys. Should I follow the crowd?

walterdavis commented 5 years ago

Note: this doesn't work yet. The method is not exposed inside the migration, even though other methods in the same file are. I am continuing to look to see how these methods are being promoted into ActiveRecord::Migration.