rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.08k stars 161 forks source link

Make default dataset available within the dataset configuration block #515

Open solnic opened 5 years ago

solnic commented 5 years ago

A common scenario is when you want to adjust the default dataset rather than setting it up from scratch, that's why it will be convenient when the default dataset is available within the Relation.dataset configuration block.

Probably the best way to do this is to tweak Gateway#dataset so that it can also accept a schema because we have it available already when dataset is retrieved from the gateway. This way the gateway will be responsible for returning the default dataset in rom-sql too (right now we use a configuration event for this). A huge benefit of this approach is that we won't have to introduce any new interface and/or change the behavior of the dataset block.

Resources