Split commit_id and noteable_id for Note

This commit is contained in:
Dmitriy Zaporozhets 2012-12-18 20:02:00 +02:00
parent aa8d4d9fea
commit 9ada678819
11 changed files with 54 additions and 28 deletions

View file

@ -203,15 +203,15 @@ class Project < ActiveRecord::Base
end
def build_commit_note(commit)
notes.new(noteable_id: commit.id, noteable_type: "Commit")
notes.new(commit_id: commit.id, noteable_type: "Commit")
end
def commit_notes(commit)
notes.where(noteable_id: commit.id, noteable_type: "Commit", line_code: nil)
notes.where(commit_id: commit.id, noteable_type: "Commit", line_code: nil)
end
def commit_line_notes(commit)
notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
notes.where(commit_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
end
def public?