Connect the source_files table with source_file_changes. With this change, source_file_changes is now a join table between commits and source files.
Add new associations so expressions like these are possible:
repository = Repository.find_by(name: "rails")
initial_commit = repository.commits.first
initial_commit.source_files.count # number of files affected by the initial commit
=> 295
gemfile = repository.source_files.find_by(filepath: "Gemfile")
gemfile.commits.count # number of commits that modifies the Gemfile
=> 879
Closes: https://github.com/visevol/GihubVisualisation/issues/29
Connect the
source_files
table withsource_file_changes
. With this change,source_file_changes
is now a join table between commits and source files.Add new associations so expressions like these are possible: