OSDN Git Service

fix not inline comments being hidden cause line_code = ''
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 4 Apr 2013 06:50:18 +0000 (09:50 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 4 Apr 2013 06:50:18 +0000 (09:50 +0300)
app/models/note.rb

index f26420c..baf0634 100644 (file)
@@ -41,7 +41,7 @@ class Note < ActiveRecord::Base
   # Scopes
   scope :for_commit_id, ->(commit_id) { where(noteable_type: "Commit", commit_id: commit_id) }
   scope :inline, -> { where("line_code IS NOT NULL") }
-  scope :not_inline, -> { where("line_code IS NULL") }
+  scope :not_inline, -> { where(line_code: [nil, '']) }
 
   scope :common, ->{ where(noteable_type: ["", nil]) }
   scope :fresh, ->{ order("created_at ASC, id ASC") }