diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-03 21:09:18 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-03 21:09:18 +0200 |
| commit | 39ba934c0a65f571214998e056e925b61f389360 (patch) | |
| tree | a1da1af6df76e1d49feffd48a6247ced3abd5684 /app/models/note.rb | |
| parent | e6c0673ef1108a93928c4d88ba273e12616b836b (diff) | |
| download | gitlab-ce-39ba934c0a65f571214998e056e925b61f389360.tar.gz | |
REpostiry, Team models
Diffstat (limited to 'app/models/note.rb')
| -rw-r--r-- | app/models/note.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 28b3879239f..100f72b6eac 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -4,7 +4,6 @@ # # id :integer not null, primary key # note :text -# noteable_id :string(255) # noteable_type :string(255) # author_id :integer # created_at :datetime not null @@ -12,6 +11,8 @@ # project_id :integer # attachment :string(255) # line_code :string(255) +# commit_id :string(255) +# noteable_id :integer # require 'carrierwave/orm/activerecord' @@ -42,7 +43,7 @@ class Note < ActiveRecord::Base # Scopes scope :for_commits, ->{ where(noteable_type: "Commit") } - scope :common, ->{ where(noteable_id: nil, commit_id: nil) } + scope :common, ->{ where(noteable_type: ["", nil]) } scope :today, ->{ where("created_at >= :date", date: Date.today) } scope :last_week, ->{ where("created_at >= :date", date: (Date.today - 7.days)) } scope :since, ->(day) { where("created_at >= :date", date: (day)) } |
