Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

  • Stan Hu's avatar
    Ensure CI pipelines and builds have the correction project associations · 26154a096200
    Stan Hu authored
    This should reduce the number of SQL queries and lookups needed to look up a
    project of a build and pipeline and vice versa.
    
    Before:
    
    ```
    [1] pry(main)> Ci::Build.reflect_on_association(:project).has_inverse?
    => false
    [2] pry(main)> Project.reflect_on_association(:builds).has_inverse?
    => false
    [3] pry(main)> Ci::Pipeline.reflect_on_association(:project).has_inverse?
    => false
    [4] pry(main)> Project.reflect_on_association(:pipelines).has_inverse?
    => :project
    ```
    
    After:
    
    ```
    [1] pry(main)> Ci::Build.reflect_on_association(:project).has_inverse?
    => :builds
    [2] pry(main)> Project.reflect_on_association(:builds).has_inverse?
    => :project
    [3] pry(main)> Ci::Pipeline.reflect_on_association(:project).has_inverse?
    => :pipelines
    [4] pry(main)> Project.reflect_on_association(:pipelines).has_inverse?
    => :project
    ```
    26154a096200
project.rb 55.2 KB