bin/pull_req_data_extraction.rb
# Number of project watchers/stargazers at the time the pull request was made
Number of project watchers/stargazers at the time the pull request was made
Number of project watchers / stargazers at the time the pull request was made
def stars(pr)
    q = <<-QUERY
    select count(w.user_id) as num_watchers
    from watchers w, pull_requests pr, pull_request_history prh
    where prh.pull_request_id = pr.id
      and w.created_at < prh.created_at
      and w.repo_id = pr.base_repo_id
      and prh.action='opened'
      and pr.id = ?
    QUERY
    db.fetch(q, pr[:id]).first[:num_watchers]
  end
def stars ( pr ) q = <<-QUERY 
    select count(w.user_id) as num_watchers
    from watchers w, pull_requests pr, pull_request_history prh
    where prh.pull_request_id = pr.id
      and w.created_at < prh.created_at
      and w.repo_id = pr.base_repo_id
      and prh.action='opened'
      and pr.id = ?
     QUERY db . fetch ( q , pr [ :id ] ) . first [ :num_watchers ] end
Number of project watchers/stargazers at the time the pull request was made
Number of project watchers / stargazers at the time the pull request was made
pr