data-import
data-import copied to clipboard
automatically add dependencies for reference blocks
this is just an idea, I'm not sure if I like it though.
I find myself writing the following code a lot:
import 'something' do
dependencies 'other thing'
reference 'other thing', 'field' => :field
end
I thought about adding the dependencies for reference
mappings automatically since the table you reference always needs to be loaded. The drawback is, that you don't see all the dependencies on a single line but it would remove some duplication.
@stmichael thoughts?
I'm a torn between yes and no. Yes because it is beneficial for smaller definitions where you see the references instantly and you don't have any other dependencies. No because it would split the dependencies into the actual dependencies and those in the references which is leads to a chaos. Then again if that happens you could still explicitly define all dependencies.
I came up with the idea because I had to switch a reference column to another definition. Of course I had to wait 30 minutes to find out, that I forgot to change the dependencies :( I think you notice it's duplication when things get more error prone than they should be.