data-import icon indicating copy to clipboard operation
data-import copied to clipboard

automatically add dependencies for reference blocks

Open senny opened this issue 12 years ago • 3 comments

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.

senny avatar Sep 17 '12 16:09 senny

@stmichael thoughts?

senny avatar Sep 17 '12 16:09 senny

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.

stmichael avatar Sep 18 '12 05:09 stmichael

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.

senny avatar Sep 18 '12 06:09 senny