bin/pull_req_data_extraction.rb
def num_commits(pr)
    q = <<-QUERY
    select count(*) as commit_count
    from pull_requests pr, pull_request_commits prc
    where pr.id = prc.pull_request_id
      and pr.id=?
    group by prc.pull_request_id
    QUERY
    begin
      db.fetch(q, pr[:id]).first[:commit_count]
    rescue
      0
    end
  end
# Number of commits in pull request
Number of commits in pull request
Number of commits in pull request
def num_commits(pr)
    q = <<-QUERY
    select count(*) as commit_count
    from pull_requests pr, pull_request_commits prc
    where pr.id = prc.pull_request_id
      and pr.id=?
    group by prc.pull_request_id
    QUERY
    begin
      db.fetch(q, pr[:id]).first[:commit_count]
    rescue
      0
    end
  end
def num_commits ( pr ) q = <<-QUERY 
    select count(*) as commit_count
    from pull_requests pr, pull_request_commits prc
    where pr.id = prc.pull_request_id
      and pr.id=?
    group by prc.pull_request_id
     QUERY begin db . fetch ( q , pr [ :id ] ) . first [ :commit_count ] rescue 0 end end
Number of commits in pull request
Number of commits in pull request
pr